|
@@ -2,6 +2,8 @@ const webpack = require('webpack'); |
|
@@ -2,6 +2,8 @@ const webpack = require('webpack'); |
2
|
var path = require('path');
|
2
|
var path = require('path');
|
3
|
let utils = require('./utils');
|
3
|
let utils = require('./utils');
|
4
|
let config = require('./config')
|
4
|
let config = require('./config')
|
|
|
5
|
+const os = require('os');
|
|
|
6
|
+const UglifyJsparallelPlugin = require('webpack-uglify-parallel');
|
5
|
const AssetsPlugin = require('assets-webpack-plugin');
|
7
|
const AssetsPlugin = require('assets-webpack-plugin');
|
6
|
let ExtractTextPlugin = require('extract-text-webpack-plugin');
|
8
|
let ExtractTextPlugin = require('extract-text-webpack-plugin');
|
7
|
|
9
|
|
|
@@ -62,10 +64,13 @@ module.exports = { |
|
@@ -62,10 +64,13 @@ module.exports = { |
62
|
new webpack.DefinePlugin({
|
64
|
new webpack.DefinePlugin({
|
63
|
'process.env': config.build.env
|
65
|
'process.env': config.build.env
|
64
|
}),
|
66
|
}),
|
65
|
- new webpack.optimize.UglifyJsPlugin({
|
67
|
+ new UglifyJsparallelPlugin({
|
|
|
68
|
+ workers: os.cpus().length,
|
|
|
69
|
+ mangle: true,
|
66
|
compress: {
|
70
|
compress: {
|
67
|
warnings: false
|
71
|
warnings: false
|
68
|
},
|
72
|
},
|
|
|
73
|
+ comments: false,
|
69
|
sourceMap: true
|
74
|
sourceMap: true
|
70
|
}),
|
75
|
}),
|
71
|
new webpack.IgnorePlugin(/^\.\/locale$/, /moment$/),
|
76
|
new webpack.IgnorePlugin(/^\.\/locale$/, /moment$/),
|