@@ -19,6 +19,7 @@ const ManifestPlugin = require('webpack-manifest-plugin');
1919const InterpolateHtmlPlugin = require ( 'react-dev-utils/InterpolateHtmlPlugin' ) ;
2020const SWPrecacheWebpackPlugin = require ( 'sw-precache-webpack-plugin' ) ;
2121const ModuleScopePlugin = require ( 'react-dev-utils/ModuleScopePlugin' ) ;
22+ const UglifyJsPlugin = require ( 'uglifyjs-webpack-plugin' ) ;
2223const paths = require ( './paths' ) ;
2324const getClientEnvironment = require ( './env' ) ;
2425
@@ -165,7 +166,7 @@ module.exports = {
165166 {
166167 test : / \. ( t s | t s x ) $ / ,
167168 include : paths . appSrc ,
168- loader : require . resolve ( 'ts-loader' )
169+ loader : require . resolve ( 'ts-loader' ) ,
169170 } ,
170171 // The notation here is somewhat confusing.
171172 // "postcss" loader applies autoprefixer to our CSS.
@@ -272,20 +273,17 @@ module.exports = {
272273 // Otherwise React will be compiled in the very slow development mode.
273274 new webpack . DefinePlugin ( env . stringified ) ,
274275 // Minify the code.
275- new webpack . optimize . UglifyJsPlugin ( {
276- compress : {
277- warnings : false ,
278- // Disabled because of an issue with Uglify breaking seemingly valid code:
279- // https://github.com/facebookincubator/create-react-app/issues/2376
280- // Pending further investigation:
281- // https://github.com/mishoo/UglifyJS2/issues/2011
282- comparisons : false ,
283- } ,
284- output : {
285- comments : false ,
286- // Turned on because emoji and regex is not minified properly using default
287- // https://github.com/facebookincubator/create-react-app/issues/2488
288- ascii_only : true ,
276+ new UglifyJsPlugin ( {
277+ //test: /.js($|?)/i //Do we need to change this for ts-loader output?
278+ parallel : true ,
279+ uglifyOptions : {
280+ ecma : 6 ,
281+ output : {
282+ comments : false ,
283+ // Turned on because emoji and regex is not minified properly using default
284+ // https://github.com/facebookincubator/create-react-app/issues/2488
285+ ascii_only : true ,
286+ } ,
289287 } ,
290288 sourceMap : shouldUseSourceMap ,
291289 } ) ,
0 commit comments