michaelficarra / CoffeeScriptRedux

:sweat: rewrite of the CoffeeScript compiler with proper compiler design principles and a focus on robustness and extensibility
https://michaelficarra.github.com/CoffeeScriptRedux/
BSD 3-Clause "New" or "Revised" License
1.84k stars 110 forks source link

What is the equivalent of require('coffee-script').compile(code, options);? #333

Closed CodisRedding closed 10 years ago

CodisRedding commented 10 years ago

What is the equivalent of require('coffee-script').compile(code, options);?

CodisRedding commented 10 years ago

I found the function cs2js here https://github.com/michaelficarra/CoffeeScriptRedux/blob/master/src/module.coffee#L68 but it doesn't work exactly like the old compile func coffeescript 1.* even though the comment is "# Equivalent to original CS compile".

When I run cs2js and pass in the option to create the source map (just like I used to in the .compile func I get an error:

Warning: Cannot read property 'length' of undefined Use --force to continue.

Aborted due to warnings.
michaelficarra commented 10 years ago

cs2js does not take the same options as compile.

CodisRedding commented 10 years ago

Great comment and insight on options. Best closed before any chat of new options. :+1: