how can I enable a source map for coffeescript?

Jerome WAGNER picture Jerome WAGNER · Jun 8, 2012 · Viewed 9.8k times · Source

I recently discovered the existence of source maps in chrome via source debugging in the haxe language. It allows to debug generated javascript inside the chrome browser while seeing the bug reason in the original source code.

Has anyone written a source map generator for coffeescript / Is coffeescript source mappable ?

It would help debug the javascript generated by coffeescript.

Answer

mquandalle picture mquandalle · Mar 6, 2013

Coffeescript 1.6 has native support for source maps.

Use the "--map" or "-m" option to enable it. Or if you use the npm compiler, you will have to add the sourceMap: true option.