grails-coffeescript-resources icon indicating copy to clipboard operation
grails-coffeescript-resources copied to clipboard

Use CoffeeScriptRedux for source mapped compilation

Open divideby0 opened this issue 13 years ago • 2 comments

There is a new coffeescript compiler, CoffeeScriptRedux, released today which supports source maps. These effectively eliminate the debugging challenges associated coffeescript by providing linkage between the compiled JavaScript and the original coffeescript file. Chrome Canary builds already support this feature, which means you can debug directly in your browser.

I've started playing around with this using CoffeeScriptRedux on the command line and its a beautiful, beautiful thing. But I'd love it even more if I could use it directly with Grails.

Unfortunately, there's no single js file for compilation in the github project. The project itself uses node.js, so I'm unclear on what exactly would need to be done to compile from Rhino. Once that part is figured out, it should simply be a matter of generating two resources: the normal compiled javascript file and the source map. We'd then need to augment the compiled Javascript file with a comment pointing to the location of the source mapped resource.

divideby0 avatar Sep 08 '12 04:09 divideby0

I've created a Github issue on the CoffeeScriptReduce project soliciting advice on how to compile from Rhino:

https://github.com/michaelficarra/CoffeeScriptRedux/issues/42

divideby0 avatar Sep 08 '12 04:09 divideby0

Please note that Coffeescript 1.6.0 now supports source maps natively:

http://coffeescript.org/#source-maps

So this would probably be safer than using redux.

divideby0 avatar Mar 04 '13 21:03 divideby0