Sebastian Hoitz
Sebastian Hoitz

Reputation: 9373

CoffeeScript source maps for nodeJS development

Now that CoffeeScript supports the new Source Map hotness, I was wondering if I can also use the source maps not just in my browser, but on the command line while developing my nodeJS apps.

I want the JS compiler to give me more useful error traces where the lines actually match with my coffeescript files instead of compiled JS files.

Upvotes: 14

Views: 3444

Answers (3)

Alon Bar David
Alon Bar David

Reputation: 1727

Until coffee-script gets some better support for require(), try this: https://npmjs.org/package/coffee-script-mapped

Upvotes: 3

esamatti
esamatti

Reputation: 18944

Now with CoffeeScript 1.6.2 it just "works" if you run your app with the coffee command :)

Upvotes: 5

constexpr
constexpr

Reputation: 1041

The source-map-support module does this, just install the module and put this at the top of your code:

require('source-map-support').install()

Upvotes: 18

Related Questions