Harry
Harry

Reputation: 55029

Coffeescript how to compile with sourcemap?

Here's how I compile:

str = CoffeeScript.compile(fs.readFileSync(file, "ascii"))

How do I get sourcemaps to work with this.

Upvotes: 0

Views: 73

Answers (1)

phenomnomnominal
phenomnomnominal

Reputation: 5515

CoffeeScript.compile takes an object as the second argument which has valid values as seen on the CoffeeScript website under 'Usage'

For your case, you want to use:

str = CoffeeScript.compile(fs.readFileSync(file, "ascii"), { map: true });

Upvotes: 1

Related Questions