Skip to content

Commit

Permalink
Don't let UMD create extraneous global variables (#10935)
Browse files Browse the repository at this point in the history
  • Loading branch information
gaearon authored Sep 29, 2017
1 parent 3a4c2a6 commit 366c4bb
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
4 changes: 3 additions & 1 deletion scripts/rollup/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
16 changes: 8 additions & 8 deletions scripts/rollup/results.json
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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,
Expand Down Expand Up @@ -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,
Expand All @@ -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,
Expand Down

0 comments on commit 366c4bb

Please sign in to comment.