Skip to content

Commit 2824bf2

Browse files
danielberndtTimer
authored andcommitted
[next] Revert to use ecma 5 in uglifyOptions (#4234)
* Revert to use ecma 5 in uglifyOptions * remove explicit ecma version from uglifyOptions settings The defaults are already what we want * be explicit of where we use ecma: 8 and ecma: 5
1 parent da518d2 commit 2824bf2

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

packages/react-scripts/config/webpack.config.prod.js

+9-1
Original file line numberDiff line numberDiff line change
@@ -378,8 +378,15 @@ module.exports = {
378378
// Minify the code.
379379
new UglifyJsPlugin({
380380
uglifyOptions: {
381-
ecma: 8,
381+
parse: {
382+
// we want uglify-js to parse ecma 8 code. However we want it to output
383+
// ecma 5 compliant code, to avoid issues with older browsers, this is
384+
// whey we put `ecma: 5` to the compress and output section
385+
// https://github.com/facebook/create-react-app/pull/4234
386+
ecma: 8,
387+
},
382388
compress: {
389+
ecma: 5,
383390
warnings: false,
384391
// Disabled because of an issue with Uglify breaking seemingly valid code:
385392
// https://github.com/facebook/create-react-app/issues/2376
@@ -391,6 +398,7 @@ module.exports = {
391398
safari10: true,
392399
},
393400
output: {
401+
ecma: 5,
394402
comments: false,
395403
// Turned on because emoji and regex is not minified properly using default
396404
// https://github.com/facebook/create-react-app/issues/2488

0 commit comments

Comments
 (0)