Skip to content

Commit 15bf2b6

Browse files
committed
Update webpack config to use parallel uglify plugin to speed up production build
1 parent 5ce5d4c commit 15bf2b6

2 files changed

Lines changed: 11 additions & 7 deletions

File tree

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,7 @@
163163
"script-loader": "^0.7.0",
164164
"style-loader": "^0.13.1",
165165
"url-loader": "^0.5.7",
166-
"webpack": "^1.14.0"
166+
"webpack": "^1.14.0",
167+
"webpack-parallel-uglify-plugin": "^0.2.0"
167168
}
168169
}

webpack.production.js

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ var webpack = require('webpack');
33
var path = require('path');
44
var ExtractTextPlugin = require("extract-text-webpack-plugin");
55
var OptimizeCssAssetsPlugin = require('optimize-css-assets-webpack-plugin');
6+
var ParallelUglifyPlugin = require('webpack-parallel-uglify-plugin');
67

78
module.exports = [Object.assign({}, baseConfig, {
89
plugins: baseConfig.plugins.concat([
@@ -11,12 +12,14 @@ module.exports = [Object.assign({}, baseConfig, {
1112
'NODE_ENV': JSON.stringify('production')
1213
}
1314
}),
14-
new webpack.optimize.UglifyJsPlugin({
15-
compress: {
16-
warnings: false
17-
},
18-
mangle: false,
19-
sourceMap: false
15+
new ParallelUglifyPlugin({
16+
uglifyJS: {
17+
compress: {
18+
warnings: false
19+
},
20+
mangle: false,
21+
sourceMap: false
22+
}
2023
}),
2124
new ExtractTextPlugin("[name].[hash].css")
2225
]),

0 commit comments

Comments
 (0)