Val*_*sin 2 node.js coffeescript npm
我正在使用'coffee-script` npm包:
var coffee = require('coffee-script');
var source = coffee.compile('target.js');
Run Code Online (Sandbox Code Playgroud)
我在source
变量里面编译了js .但它也包含在自我调用函数中.我不需要那个调用,b/c我Webmake
用来管理依赖项,包装每个文件..我将有2个调用.
"some.js": function (exports, module, require) {
(function() {
var n;
n = 5;
alert("hello world " + n);
}).call(this);
}
Run Code Online (Sandbox Code Playgroud)
如您所见,我不需要咖啡脚本调用.PS我找不到任何关于CoffeeScript.compile
第二个参数的选项的文档.compile
.你能告诉我这些信息吗?谢谢.
归档时间: |
|
查看次数: |
447 次 |
最近记录: |