Upgrade Webpacker to version 2.0 (#3729)

This commit is contained in:
Yamagishi Kazutoshi
2017-06-18 09:57:09 +09:00
committed by Eugen Rochko
parent 94d0e012de
commit 53e42bf91e
17 changed files with 241 additions and 128 deletions

View File

@ -7,26 +7,27 @@ const sharedConfig = require('./shared.js');
const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin;
module.exports = merge(sharedConfig, {
devtool: 'source-map', // separate sourcemap file, suitable for production
output: { filename: '[name]-[chunkhash].js' },
devtool: 'source-map', // separate sourcemap file, suitable for production
stats: 'normal',
plugins: [
new webpack.optimize.UglifyJsPlugin({
compress: true,
sourceMap: true,
mangle: true,
compress: {
warnings: false,
},
output: {
comments: false,
},
sourceMap: true,
}),
new CompressionPlugin({
asset: '[path].gz[query]',
algorithm: 'gzip',
test: /\.(js|css|svg|eot|ttf|woff|woff2)$/,
test: /\.(js|css|html|json|ico|svg|eot|otf|ttf)$/,
}),
new BundleAnalyzerPlugin({ // generates report.html and stats.json
analyzerMode: 'static',