我正在使用google-closure compiler grunt任务来缩小javascript文件。我定义的任务如下:
'closure-compiler': {
deviceDetails: {
files: {
'target.min.js: 'source.js'
},
options: {
compilation_level: 'SIMPLE'
}
// args: [
// '--js', 'source.js',
// '--compilation_level', 'SIMPLE',
// '--js_output_file', 'out.js',
// '--debug'
// ]
}这给了我一个错误
[ { '29': 1,
_state: 2,
_result: [Error: not implemented],
_subscribers: [] } ]
Warning: Compilation error Use --force to continue.
Aborted due to warnings.早些时候,我遇到了promise问题,为此我安装了pollyfill模块。
require('es6-promise').polyfill();我正在运行npm 1.3.10版本,不幸的是,我现在不能升级它。
此外,还遵循了使用args的替代方法。仍然面临同样的错误。
发布于 2016-07-22 04:28:59
因此,在bit分析之后,我使用了下面两个grunt插件
1. grunt-closure-tools
2. google-closure-compilerIts是遗留npm版本的一个问题。
https://stackoverflow.com/questions/38475963
复制相似问题