以下是我编译:Coffeescript如何使用sourcemap进行编译?
str = CoffeeScript.compile(fs.readFileSync(file, "ascii"))
我如何sourcemaps与这方面的工作。
以下是我编译:Coffeescript如何使用sourcemap进行编译?
str = CoffeeScript.compile(fs.readFileSync(file, "ascii"))
我如何sourcemaps与这方面的工作。
CoffeeScript.compile
需要对象为具有如参见下的“用法”
对于你的情况CoffeeScript website有效值第二个参数,你要使用:
str = CoffeeScript.compile(fs.readFileSync(file, "ascii"), { map: true });
你只是想生成编译时的sourceMap,还是有兴趣在编译后使用它们? 'coffee-script.coffee'中的'Error.prepareStackTrace'函数是我见过的使用sourceMap的主要示例(尽管它不使用'v3'形式)。 – hpaulj