Webpack 网页中的源地图+;闭包编译器
我想使用Webpack使用闭包编译器生成的SourceMaps,但我不知道怎么做 这是我的网页配置:Webpack 网页中的源地图+;闭包编译器,webpack,google-closure-compiler,source-maps,Webpack,Google Closure Compiler,Source Maps,我想使用Webpack使用闭包编译器生成的SourceMaps,但我不知道怎么做 这是我的网页配置: const ClosureCompiler = require('google-closure-compiler-js').webpack; module.exports = { devtool: 'source-map', entry: './src/app.js', output: { path: __dirname + "/build/",
const ClosureCompiler = require('google-closure-compiler-js').webpack;
module.exports = {
devtool: 'source-map',
entry: './src/app.js',
output: {
path: __dirname + "/build/",
filename: "bundle.js",
//sourceMapFilename: "./app.js.map",
},
plugins: [
new ClosureCompiler({
compiler: {
language_in: 'ECMASCRIPT5',
language_out: 'ECMASCRIPT5',
compilation_level: 'ADVANCED',
create_source_map: __dirname + './output.js.map'
},
concurrency: 3,
})
]
};
当我运行webpack时,什么都没有发生。为什么?我做错了什么?
感谢您的帮助。使用最新版本的google closure compiler js(
20170910.0.1
),我可以使用以下选项使其工作:
plugins: [
new ClosureCompiler({
options: {
languageIn: 'ECMASCRIPT6',
languageOut: 'ECMASCRIPT5',
compilationLevel: 'ADVANCED',
createSourceMap: true
}
})
]