@@ -12,6 +12,7 @@ const autoprefixer = require('autoprefixer');
12
12
const path = require ( 'path' ) ;
13
13
const webpack = require ( 'webpack' ) ;
14
14
const HtmlWebpackPlugin = require ( 'html-webpack-plugin' ) ;
15
+ const UglifyJsPlugin = require ( 'uglifyjs-webpack-plugin' ) ;
15
16
const ExtractTextPlugin = require ( 'extract-text-webpack-plugin' ) ;
16
17
const ManifestPlugin = require ( 'webpack-manifest-plugin' ) ;
17
18
const InterpolateHtmlPlugin = require ( 'react-dev-utils/InterpolateHtmlPlugin' ) ;
@@ -290,24 +291,31 @@ module.exports = {
290
291
// Otherwise React will be compiled in the very slow development mode.
291
292
new webpack . DefinePlugin ( env . stringified ) ,
292
293
// Minify the code.
293
- new webpack . optimize . UglifyJsPlugin ( {
294
- compress : {
295
- warnings : false ,
296
- // Disabled because of an issue with Uglify breaking seemingly valid code:
297
- // https://github.com/facebookincubator/create-react-app/issues/2376
298
- // Pending further investigation:
299
- // https://github.com/mishoo/UglifyJS2/issues/2011
300
- comparisons : false ,
301
- } ,
302
- mangle : {
303
- safari10 : true ,
304
- } ,
305
- output : {
306
- comments : false ,
307
- // Turned on because emoji and regex is not minified properly using default
308
- // https://github.com/facebookincubator/create-react-app/issues/2488
309
- ascii_only : true ,
294
+ new UglifyJsPlugin ( {
295
+ uglifyOptions : {
296
+ compress : {
297
+ warnings : false ,
298
+ // Disabled because of an issue with Uglify breaking seemingly valid code:
299
+ // https://github.com/facebookincubator/create-react-app/issues/2376
300
+ // Pending further investigation:
301
+ // https://github.com/mishoo/UglifyJS2/issues/2011
302
+ comparisons : false ,
303
+ } ,
304
+ mangle : {
305
+ safari10 : true ,
306
+ } ,
307
+ output : {
308
+ comments : false ,
309
+ // Turned on because emoji and regex is not minified properly using default
310
+ // https://github.com/facebookincubator/create-react-app/issues/2488
311
+ ascii_only : true ,
312
+ } ,
310
313
} ,
314
+ // Use multi-process parallel running to improve the build speed
315
+ // Default number of concurrent runs: os.cpus().length - 1
316
+ parallel : true ,
317
+ // Enable file caching
318
+ cache : true ,
311
319
sourceMap : shouldUseSourceMap ,
312
320
} ) ,
313
321
// Note: this won't work without ExtractTextPlugin.extract(..) in `loaders`.
0 commit comments