@@ -21,6 +21,7 @@ const ForkTsCheckerWebpackPlugin = require('fork-ts-checker-webpack-plugin');
2121const paths = require ( './paths' ) ;
2222const getClientEnvironment = require ( './env' ) ;
2323const TsconfigPathsPlugin = require ( 'tsconfig-paths-webpack-plugin' ) ;
24+ const UglifyJsPlugin = require ( 'uglifyjs-webpack-plugin' ) ;
2425
2526// Webpack uses `publicPath` to determine where the app is being served from.
2627// It requires a trailing slash, or the file assets will get an incorrect path.
@@ -296,23 +297,28 @@ module.exports = {
296297 // Otherwise React will be compiled in the very slow development mode.
297298 new webpack . DefinePlugin ( env . stringified ) ,
298299 // Minify the code.
299- new webpack . optimize . UglifyJsPlugin ( {
300- compress : {
301- warnings : false ,
302- // Disabled because of an issue with Uglify breaking seemingly valid code:
303- // https://github.com/facebookincubator/create-react-app/issues/2376
304- // Pending further investigation:
305- // https://github.com/mishoo/UglifyJS2/issues/2011
306- comparisons : false ,
307- } ,
308- mangle : {
309- safari10 : true ,
310- } ,
311- output : {
312- comments : false ,
313- // Turned on because emoji and regex is not minified properly using default
314- // https://github.com/facebookincubator/create-react-app/issues/2488
315- ascii_only : true ,
300+ new UglifyJsPlugin ( {
301+ parallel : true ,
302+ cache : true ,
303+ uglifyOptions : {
304+ ecma : 8 ,
305+ compress : {
306+ warnings : false ,
307+ // Disabled because of an issue with Uglify breaking seemingly valid code:
308+ // https://github.com/facebookincubator/create-react-app/issues/2376
309+ // Pending further investigation:
310+ // https://github.com/mishoo/UglifyJS2/issues/2011
311+ comparisons : false ,
312+ } ,
313+ mangle : {
314+ safari10 : true ,
315+ } ,
316+ output : {
317+ comments : false ,
318+ // Turned on because emoji and regex is not minified properly using default
319+ // https://github.com/facebookincubator/create-react-app/issues/2488
320+ ascii_only : true ,
321+ } ,
316322 } ,
317323 sourceMap : shouldUseSourceMap ,
318324 } ) ,
0 commit comments