Google Closure Compiler plugin for webpack built on the Nailgun JVM.
MIT License
npm install closure-compiler-webpack-plugin
// webpack.config.js
var ClosureCompilerPlugin = require('closure-compiler-webpack-plugin');
module.exports = {
entry: {
core: './core',
home: './home'
},
output: {
filename: '[name].min.js'
},
devtool: 'source-map',
plugins: [
new ClosureCompilerPlugin()
]
};
Use Closure Compiler's flags.
// webpack.config.js
...
plugins: [
new ClosureCompilerPlugin({
compilation_level: 'ADVANCED',
create_source_map: false
// Use 'create_source_map: false' to override your webpack
// config. Otherwise, anything you set for this option will be
// ignored in favour of your 'devtool' and filename configuration.
})
]
...
For a list of available options:
java -jar node_modules/closure-compiler-webpack-plugin/node_modules/google-closure-compiler/compiler.jar --help
Here are some notes, where this package could be improved. Feel free to submit PRs :)