Don't let UMD create extraneous global variables (#10935)

This commit is contained in:
Dan Abramov
2017-09-29 12:48:33 +01:00
committed by GitHub
parent 3a4c2a661f
commit 366c4bb5cb
2 changed files with 11 additions and 9 deletions

View File

@@ -350,7 +350,9 @@ function getPlugins(
languageOut: 'ECMASCRIPT5_STRICT',
env: 'CUSTOM',
warningLevel: 'QUIET',
assumeFunctionWrapper: true,
// Don't let it create global variables in the browser.
// https://github.com/facebook/react/issues/10909
assumeFunctionWrapper: bundleType !== UMD_PROD,
applyInputSourceMaps: false,
useTypesForOptimization: false,
processCommonJsModules: false,

View File

@@ -5,8 +5,8 @@
"gzip": 16507
},
"react.production.min.js (UMD_PROD)": {
"size": 6598,
"gzip": 2753
"size": 6634,
"gzip": 2764
},
"react.development.js (NODE_DEV)": {
"size": 55305,
@@ -29,8 +29,8 @@
"gzip": 148516
},
"react-dom.production.min.js (UMD_PROD)": {
"size": 102900,
"gzip": 32047
"size": 101633,
"gzip": 32093
},
"react-dom.development.js (NODE_DEV)": {
"size": 606589,
@@ -61,8 +61,8 @@
"gzip": 22083
},
"react-dom-unstable-native-dependencies.production.min.js (UMD_PROD)": {
"size": 15415,
"gzip": 5073
"size": 15432,
"gzip": 5071
},
"react-dom-unstable-native-dependencies.development.js (NODE_DEV)": {
"size": 81143,
@@ -85,8 +85,8 @@
"gzip": 34451
},
"react-dom-server.browser.production.min.js (UMD_PROD)": {
"size": 14959,
"gzip": 5859
"size": 14948,
"gzip": 5844
},
"react-dom-server.browser.development.js (NODE_DEV)": {
"size": 104475,