diff --git a/packages/react-scripts/config/webpack.config.prod.js b/packages/react-scripts/config/webpack.config.prod.js index e76f67d60d2..b3c4a602cd4 100644 --- a/packages/react-scripts/config/webpack.config.prod.js +++ b/packages/react-scripts/config/webpack.config.prod.js @@ -379,9 +379,10 @@ module.exports = { new UglifyJsPlugin({ uglifyOptions: { parse: { - // we want uglify-js to parse ecma 8 code. However we want it to output - // ecma 5 compliant code, to avoid issues with older browsers, this is - // whey we put `ecma: 5` to the compress and output section + // we want uglify-js to parse ecma 8 code. However, we don't want it + // to apply any minfication steps that turns valid ecma 5 code + // into invalid ecma 5 code. This is why the 'compress' and 'output' + // sections only apply transformations that are ecma 5 safe // https://github.com/facebook/create-react-app/pull/4234 ecma: 8, },