From aadae6a11f121cc8e45e2a64efb095bb8960f390 Mon Sep 17 00:00:00 2001 From: Peter-Paul Date: Mon, 6 Aug 2018 08:57:06 +0200 Subject: [PATCH] fix: don't let uglify-es inline functions with arguments Fixes #346. This is a workaround for a bug in uglifyjs2 (https://github.com/mishoo/UglifyJS2/issues/2842), which can cause name collisions when a function with arguments is inlined. This can cause an unintended shadowing of a `var` or `let`, or a `TypeError: Assignment to constant variable` in case of a `const`. --- packages/react-scripts/config/webpack.config.prod.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/react-scripts/config/webpack.config.prod.js b/packages/react-scripts/config/webpack.config.prod.js index 7cb33afd0..0d6dd8e38 100644 --- a/packages/react-scripts/config/webpack.config.prod.js +++ b/packages/react-scripts/config/webpack.config.prod.js @@ -315,6 +315,9 @@ module.exports = { // Pending further investigation: // https://github.com/mishoo/UglifyJS2/issues/2011 comparisons: false, + // Don't inline functions with arguments, to avoid name collisions: + // https://github.com/mishoo/UglifyJS2/issues/2842 + inline: 1, }, mangle: { safari10: true, pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy