Google Closure Compiler plugin for Webpack
npm i -D webpack-closure-compiler
A hash of options to pass to google-closure-compiler.
The maximum number of compiler instances to run in parallel, defaults to 1
.
Process only files which filename satisfies specified RegExp, defaults to /\.js($|\?)/i
.
var path = require('path');
var ClosureCompilerPlugin = require('webpack-closure-compiler');
module.exports = {
entry: [
path.join(__dirname, 'app.js')
],
module: {
loaders: [
{ test: /\.js$/, exclude: /node_modules/, loaders: ['babel-loader?optional=runtime&stage=0&cacheDirectory'] }
]
},
output: {
path: path.join(__dirname, '/'),
filename: 'app.min.js'
},
plugins: [
new ClosureCompilerPlugin({
compiler: {
language_in: 'ECMASCRIPT6',
language_out: 'ECMASCRIPT5',
compilation_level: 'ADVANCED'
},
concurrency: 3,
})
]
};
MIT