【发布时间】:2012-05-03 07:01:14
【问题描述】:
我正在使用 'coffee-script` npm 包:
var coffee = require('coffee-script');
var source = coffee.compile('target.js');
我已经在 source 变量中编译了 js。但它也包含在自调用函数中。我不需要那个调用,b/c 我使用Webmake 来管理依赖项,它包装了每个文件.. 我将有 2 次调用。
"some.js": function (exports, module, require) {
(function() {
var n;
n = 5;
alert("hello world " + n);
}).call(this);
}
如您所见,我不需要咖啡脚本调用。
附:我找不到任何关于CoffeeScript.compile 选项的文档,这是.compile 的第二个参数。你能不能也给我提供这些信息。谢谢。
【问题讨论】:
标签: node.js coffeescript npm