Skip to content

Commit

Permalink
Update webpack config to use parallel uglify plugin to speed up produ…
Browse files Browse the repository at this point in the history
…ction build
  • Loading branch information
jackycute committed Feb 3, 2017
1 parent 5ce5d4c commit 15bf2b6
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@
"script-loader": "^0.7.0",
"style-loader": "^0.13.1",
"url-loader": "^0.5.7",
"webpack": "^1.14.0"
"webpack": "^1.14.0",
"webpack-parallel-uglify-plugin": "^0.2.0"
}
}
15 changes: 9 additions & 6 deletions webpack.production.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ var webpack = require('webpack');
var path = require('path');
var ExtractTextPlugin = require("extract-text-webpack-plugin");
var OptimizeCssAssetsPlugin = require('optimize-css-assets-webpack-plugin');
var ParallelUglifyPlugin = require('webpack-parallel-uglify-plugin');

module.exports = [Object.assign({}, baseConfig, {
plugins: baseConfig.plugins.concat([
Expand All @@ -11,12 +12,14 @@ module.exports = [Object.assign({}, baseConfig, {
'NODE_ENV': JSON.stringify('production')
}
}),
new webpack.optimize.UglifyJsPlugin({
compress: {
warnings: false
},
mangle: false,
sourceMap: false
new ParallelUglifyPlugin({
uglifyJS: {
compress: {
warnings: false
},
mangle: false,
sourceMap: false
}
}),
new ExtractTextPlugin("[name].[hash].css")
]),
Expand Down

0 comments on commit 15bf2b6

Please sign in to comment.