【发布时间】:2014-03-05 07:29:51
【问题描述】:
他们还是直接生成缩小的 js 吗?我不想使用其他命令,例如 grunt uglify,因为源映射不会指向咖啡而是指向 js
【问题讨论】:
标签: coffeescript gruntjs
他们还是直接生成缩小的 js 吗?我不想使用其他命令,例如 grunt uglify,因为源映射不会指向咖啡而是指向 js
【问题讨论】:
标签: coffeescript gruntjs
我明白你对源图的看法,但你仍然可以在链中使用 uglify 来获得你想要的东西。 Uglify 可以使用其 sourceMapIn 选项让最终的源映射指向原始咖啡文件:
grunt.initConfig({
coffee: {
options: {
sourceMap: true // causes creation of landing.js.map
},
files: { 'src/landing.js': 'src/landing.coffee' }
},
uglify: {
options: {
sourceMap: true,
sourceMapIn: 'src/landing.js.map'
},
files: { 'src/landing.min.js': ['src/landing.js'] }
}
});
【讨论】:
没有,抱歉。
https://github.com/gruntjs/grunt-contrib-coffee/issues/102
如果您的目的是调试服务器端代码,请尝试使用 coffee 二进制文件运行应用程序,而不是将其编译为 JS 并以 node 开头。
【讨论】: