使用 grunt 闭包编译器生成源映射?
generate source map with grunt closure compiler?
有没有办法用 grunt 闭包编译器生成源映射?
我都试过了 grunt-closure-compiler and grunt-closure-tools 但我似乎无法生成源映射文件。
这是我的设置:
在这里,我在 options
内部和外部都进行了尝试,两者的值都是 true
或 path/to/src.map
。我找不到这方面的文档。
'closure-compiler': {
lib : {
closurePath: 'closure-compiler',
js: 'path/to/src.js',
jsOutputFile: 'path/to/output.js',
maxBuffer: 10000,
// sourceMap: true / 'path/to/src.map'
options: {
compilation_level: 'ADVANCED_OPTIMIZATIONS',
language_in: 'ECMASCRIPT5',
externs: ['externs/*.js'],
// sourceMap: true / 'path/to/src.map'
}
}
},
在这里,我按照文档进行操作,但无法正常工作。
closureCompiler: {
options: {
compilerFile: 'closure-compiler/build/compiler.jar',
create_source_map: 'path/to/src.map',
compilation_level: 'ADVANCED_OPTIMIZATIONS',
externs: ['externs/*.js']
},
lib : {
src: 'path/to/src.js',
dest: 'path/to/output.js'
}
}
我错过了什么?
对于 grunt-closure-compiler
,这适用于我的项目:
'closure-compiler': {
dev: {
js: ['src/**/*.js'],
jsOutputFile: 'dist/js/output.js',
maxBuffer: 500,
noreport: true,
options: {
compilation_level: 'ADVANCED_OPTIMIZATIONS',
language_in: 'ECMASCRIPT5_STRICT',
warning_level: 'VERBOSE',
use_types_for_optimization: undefined,
output_wrapper: '(function(){%output%\n}).call(window)',
create_source_map: 'dist/js/output.js.map'
}
}
}
有没有办法用 grunt 闭包编译器生成源映射?
我都试过了 grunt-closure-compiler and grunt-closure-tools 但我似乎无法生成源映射文件。
这是我的设置:
在这里,我在 options
内部和外部都进行了尝试,两者的值都是 true
或 path/to/src.map
。我找不到这方面的文档。
'closure-compiler': {
lib : {
closurePath: 'closure-compiler',
js: 'path/to/src.js',
jsOutputFile: 'path/to/output.js',
maxBuffer: 10000,
// sourceMap: true / 'path/to/src.map'
options: {
compilation_level: 'ADVANCED_OPTIMIZATIONS',
language_in: 'ECMASCRIPT5',
externs: ['externs/*.js'],
// sourceMap: true / 'path/to/src.map'
}
}
},
在这里,我按照文档进行操作,但无法正常工作。
closureCompiler: {
options: {
compilerFile: 'closure-compiler/build/compiler.jar',
create_source_map: 'path/to/src.map',
compilation_level: 'ADVANCED_OPTIMIZATIONS',
externs: ['externs/*.js']
},
lib : {
src: 'path/to/src.js',
dest: 'path/to/output.js'
}
}
我错过了什么?
对于 grunt-closure-compiler
,这适用于我的项目:
'closure-compiler': {
dev: {
js: ['src/**/*.js'],
jsOutputFile: 'dist/js/output.js',
maxBuffer: 500,
noreport: true,
options: {
compilation_level: 'ADVANCED_OPTIMIZATIONS',
language_in: 'ECMASCRIPT5_STRICT',
warning_level: 'VERBOSE',
use_types_for_optimization: undefined,
output_wrapper: '(function(){%output%\n}).call(window)',
create_source_map: 'dist/js/output.js.map'
}
}
}