diff options
author | Wu Cheng-Han | 2017-02-03 22:05:09 +0800 |
---|---|---|
committer | Wu Cheng-Han | 2017-02-03 22:05:09 +0800 |
commit | 15bf2b6da859f2ab73fab5838689291830005c66 (patch) | |
tree | 2636c6f94a6846293d95052862d36a152838fc8f | |
parent | 5ce5d4cd849f764cc563fc4cb1f3288ebb14a2a4 (diff) |
Update webpack config to use parallel uglify plugin to speed up production build
-rw-r--r-- | package.json | 3 | ||||
-rw-r--r-- | webpack.production.js | 15 |
2 files changed, 11 insertions, 7 deletions
diff --git a/package.json b/package.json index 74de2c80..d5e8e55c 100644 --- a/package.json +++ b/package.json @@ -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" } } diff --git a/webpack.production.js b/webpack.production.js index b28c34ae..7c690d28 100644 --- a/webpack.production.js +++ b/webpack.production.js @@ -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([ @@ -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") ]), |