@@ -12,6 +12,7 @@ const autoprefixer = require('autoprefixer');
1212const  path  =  require ( 'path' ) ; 
1313const  webpack  =  require ( 'webpack' ) ; 
1414const  HtmlWebpackPlugin  =  require ( 'html-webpack-plugin' ) ; 
15+ const  UglifyJsPlugin  =  require ( 'uglifyjs-webpack-plugin' ) ; 
1516const  ExtractTextPlugin  =  require ( 'extract-text-webpack-plugin' ) ; 
1617const  ManifestPlugin  =  require ( 'webpack-manifest-plugin' ) ; 
1718const  InterpolateHtmlPlugin  =  require ( 'react-dev-utils/InterpolateHtmlPlugin' ) ; 
@@ -290,24 +291,31 @@ module.exports = {
290291    // Otherwise React will be compiled in the very slow development mode. 
291292    new  webpack . DefinePlugin ( env . stringified ) , 
292293    // 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+         } , 
310313      } , 
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 , 
311319      sourceMap : shouldUseSourceMap , 
312320    } ) , 
313321    // Note: this won't work without ExtractTextPlugin.extract(..) in `loaders`. 
0 commit comments