Update Rollup (#11427)
* Update Rollup * Strip "use strict" in individual modules * Record sizes
Dan Abramov committed
Nov 2, 2017 at 16:56 UTC
fbf617a2639ba0dd38bce902e3565fa608f89b8b
4 files changed
+120
-96
package.json
+2
-2
@@ -76,11 +76,11 @@
76
"prettier": "1.2.2",
77
"prop-types": "^15.6.0",
78
"rimraf": "^2.6.1",
79
- "rollup": "^0.41.6",
79
+ "rollup": "^0.49.3",
80
"rollup-plugin-alias": "^1.2.1",
81
"rollup-plugin-babel": "^2.7.1",
82
"rollup-plugin-closure-compiler-js": "^1.0.4",
83
- "rollup-plugin-commonjs": "^8.0.2",
83
+ "rollup-plugin-commonjs": "^8.2.6",
84
"rollup-plugin-inject": "^2.0.0",
85
"rollup-plugin-node-resolve": "^2.0.0",
86
"rollup-plugin-replace": "^1.1.1",
scripts/rollup/build.js
+16
-4
@@ -237,7 +237,7 @@ function getRollupOutputOptions(
237
{
238
banner: getBanner(bundleType, globalName, filename, moduleType),
239
destDir: 'build/',
240
- dest: 'build/' +
240
+ file: 'build/' +
241
Packaging.getOutputPathRelativeToBuildFolder(
242
bundleType,
243
filename,
@@ -247,8 +247,8 @@ function getRollupOutputOptions(
247
format,
248
globals,
249
interop: false,
250
- moduleName: globalName,
251
- sourceMap: false,
250
+ name: globalName,
251
+ sourcemap: false,
252
}
253
);
254
}
@@ -372,6 +372,17 @@ function rewriteFBReactImport() {
372
};
373
}
374
375
+// Strip 'use strict' directives in individual modules
376
+// because we always emit them in the file headers.
377
+// The whole bundle is strict.
378
+function stripUseStrict() {
379
+ return {
380
+ transform(source) {
381
+ return source.replace(/['"]use strict['"']/g, '');
382
+ },
383
+ };
384
+}
385
+
386
// Plugin that writes to the error code file so that by the time it is picked
387
// up by Babel, the errors are already extracted.
388
function writeErrorCodes() {
@@ -403,6 +414,7 @@ function getPlugins(
414
skip: externals,
415
}),
416
babel(getBabelConfig(updateBabelOptions, bundleType)),
417
+ stripUseStrict(),
418
].filter(Boolean);
419
420
const headerSanityCheck = getHeaderSanityCheck(bundleType, globalName);
@@ -535,7 +547,7 @@ function createBundle(bundle, bundleType) {
547
548
console.log(`${chalk.bgYellow.black(' BUILDING ')} ${logKey}`);
549
return rollup({
538
- entry: resolvedEntry,
550
+ input: resolvedEntry,
551
external(id) {
552
const containsThisModule = pkg => id === pkg || id.startsWith(pkg + '/');
553
const isProvidedByDependency = externals.some(containsThisModule);
scripts/rollup/results.json
+72
-72
@@ -1,208 +1,208 @@
1
{
2
"bundleSizes": {
3
"react.development.js (UMD_DEV)": {
4
- "size": 57801,
5
- "gzip": 15092
4
+ "size": 60014,
5
+ "gzip": 15266
6
},
7
"react.production.min.js (UMD_PROD)": {
8
"size": 6833,
9
"gzip": 2793
10
},
11
"react.development.js (NODE_DEV)": {
12
- "size": 48705,
13
- "gzip": 12829
12
+ "size": 50504,
13
+ "gzip": 12978
14
},
15
"react.production.min.js (NODE_PROD)": {
16
"size": 5810,
17
"gzip": 2397
18
},
19
"React-dev.js (FB_DEV)": {
20
- "size": 45559,
21
- "gzip": 11962
20
+ "size": 47342,
21
+ "gzip": 12109
22
},
23
"React-prod.js (FB_PROD)": {
24
- "size": 25284,
25
- "gzip": 6818
24
+ "size": 25195,
25
+ "gzip": 6775
26
},
27
"react-dom.development.js (UMD_DEV)": {
28
- "size": 609859,
29
- "gzip": 139935
28
+ "size": 627487,
29
+ "gzip": 140353
30
},
31
"react-dom.production.min.js (UMD_PROD)": {
32
"size": 103841,
33
"gzip": 32439
34
},
35
"react-dom.development.js (NODE_DEV)": {
36
- "size": 592196,
37
- "gzip": 135632
36
+ "size": 609023,
37
+ "gzip": 135899
38
},
39
"react-dom.production.min.js (NODE_PROD)": {
40
"size": 107507,
41
"gzip": 33239
42
},
43
"ReactDOM-dev.js (FB_DEV)": {
44
- "size": 592099,
45
- "gzip": 135900
44
+ "size": 609049,
45
+ "gzip": 136235
46
},
47
"ReactDOM-prod.js (FB_PROD)": {
48
- "size": 421332,
49
- "gzip": 93627
48
+ "size": 422543,
49
+ "gzip": 93634
50
},
51
"react-dom-test-utils.development.js (NODE_DEV)": {
52
- "size": 41544,
53
- "gzip": 11072
52
+ "size": 42927,
53
+ "gzip": 11123
54
},
55
"react-dom-test-utils.production.min.js (NODE_PROD)": {
56
"size": 11600,
57
"gzip": 4242
58
},
59
"ReactTestUtils-dev.js (FB_DEV)": {
60
- "size": 41162,
61
- "gzip": 11036
60
+ "size": 42537,
61
+ "gzip": 11084
62
},
63
"react-dom-unstable-native-dependencies.development.js (UMD_DEV)": {
64
- "size": 84853,
65
- "gzip": 21148
64
+ "size": 87597,
65
+ "gzip": 21191
66
},
67
"react-dom-unstable-native-dependencies.production.min.js (UMD_PROD)": {
68
"size": 14441,
69
"gzip": 4652
70
},
71
"react-dom-unstable-native-dependencies.development.js (NODE_DEV)": {
72
- "size": 80634,
73
- "gzip": 19920
72
+ "size": 83185,
73
+ "gzip": 19958
74
},
75
"react-dom-unstable-native-dependencies.production.min.js (NODE_PROD)": {
76
"size": 14002,
77
"gzip": 4509
78
},
79
"ReactDOMUnstableNativeDependencies-dev.js (FB_DEV)": {
80
- "size": 80127,
81
- "gzip": 19865
80
+ "size": 82662,
81
+ "gzip": 19896
82
},
83
"ReactDOMUnstableNativeDependencies-prod.js (FB_PROD)": {
84
- "size": 65135,
85
- "gzip": 15542
84
+ "size": 65698,
85
+ "gzip": 15563
86
},
87
"react-dom-server.browser.development.js (UMD_DEV)": {
88
- "size": 106084,
89
- "gzip": 27905
88
+ "size": 110696,
89
+ "gzip": 28081
90
},
91
"react-dom-server.browser.production.min.js (UMD_PROD)": {
92
"size": 15612,
93
"gzip": 6067
94
},
95
"react-dom-server.browser.development.js (NODE_DEV)": {
96
- "size": 96070,
97
- "gzip": 25231
96
+ "size": 99885,
97
+ "gzip": 25360
98
},
99
"react-dom-server.browser.production.min.js (NODE_PROD)": {
100
"size": 15340,
101
"gzip": 5985
102
},
103
"ReactDOMServer-dev.js (FB_DEV)": {
104
- "size": 95546,
105
- "gzip": 25176
104
+ "size": 99347,
105
+ "gzip": 25283
106
},
107
"ReactDOMServer-prod.js (FB_PROD)": {
108
- "size": 43775,
109
- "gzip": 12037
108
+ "size": 44385,
109
+ "gzip": 12018
110
},
111
"react-dom-server.node.development.js (NODE_DEV)": {
112
- "size": 98343,
113
- "gzip": 25770
112
+ "size": 102342,
113
+ "gzip": 25902
114
},
115
"react-dom-server.node.production.min.js (NODE_PROD)": {
116
"size": 16264,
117
"gzip": 6314
118
},
119
"react-art.development.js (UMD_DEV)": {
120
- "size": 375506,
121
- "gzip": 82485
120
+ "size": 380741,
121
+ "gzip": 82697
122
},
123
"react-art.production.min.js (UMD_PROD)": {
124
"size": 85627,
125
"gzip": 26501
126
},
127
"react-art.development.js (NODE_DEV)": {
128
- "size": 301272,
129
- "gzip": 63673
128
+ "size": 306108,
129
+ "gzip": 63796
130
},
131
"react-art.production.min.js (NODE_PROD)": {
132
"size": 54751,
133
"gzip": 17093
134
},
135
"ReactART-dev.js (FB_DEV)": {
136
- "size": 299806,
137
- "gzip": 63594
136
+ "size": 304608,
137
+ "gzip": 63722
138
},
139
"ReactART-prod.js (FB_PROD)": {
140
- "size": 223978,
141
- "gzip": 46106
140
+ "size": 223549,
141
+ "gzip": 46009
142
},
143
"ReactNativeRenderer-dev.js (RN_DEV)": {
144
- "size": 288447,
145
- "gzip": 49547
144
+ "size": 288535,
145
+ "gzip": 49541
146
},
147
"ReactNativeRenderer-prod.js (RN_PROD)": {
148
- "size": 224942,
149
- "gzip": 38550
148
+ "size": 224626,
149
+ "gzip": 38486
150
},
151
"ReactRTRenderer-dev.js (RN_DEV)": {
152
- "size": 219451,
153
- "gzip": 37090
152
+ "size": 219434,
153
+ "gzip": 37080
154
},
155
"ReactRTRenderer-prod.js (RN_PROD)": {
156
- "size": 165813,
157
- "gzip": 27635
156
+ "size": 165404,
157
+ "gzip": 27562
158
},
159
"ReactCSRenderer-dev.js (RN_DEV)": {
160
- "size": 205992,
161
- "gzip": 34497
160
+ "size": 205961,
161
+ "gzip": 34476
162
},
163
"ReactCSRenderer-prod.js (RN_PROD)": {
164
- "size": 153977,
165
- "gzip": 25225
164
+ "size": 153554,
165
+ "gzip": 25147
166
},
167
"react-test-renderer.development.js (NODE_DEV)": {
168
- "size": 305130,
169
- "gzip": 64110
168
+ "size": 310373,
169
+ "gzip": 64233
170
},
171
"react-test-renderer.production.min.js (NODE_PROD)": {
172
"size": 56345,
173
"gzip": 17428
174
},
175
"ReactTestRenderer-dev.js (FB_DEV)": {
176
- "size": 303654,
177
- "gzip": 64031
176
+ "size": 308861,
177
+ "gzip": 64158
178
},
179
"react-test-renderer-shallow.development.js (NODE_DEV)": {
180
- "size": 9246,
181
- "gzip": 2306
180
+ "size": 9638,
181
+ "gzip": 2313
182
},
183
"react-test-renderer-shallow.production.min.js (NODE_PROD)": {
184
"size": 4634,
185
"gzip": 1667
186
},
187
"ReactShallowRenderer-dev.js (FB_DEV)": {
188
- "size": 8958,
189
- "gzip": 2250
188
+ "size": 9344,
189
+ "gzip": 2258
190
},
191
"react-noop-renderer.development.js (NODE_DEV)": {
192
- "size": 294464,
193
- "gzip": 61371
192
+ "size": 299390,
193
+ "gzip": 61718
194
},
195
"react-reconciler.development.js (NODE_DEV)": {
196
- "size": 280011,
197
- "gzip": 58128
196
+ "size": 284277,
197
+ "gzip": 58250
198
},
199
"react-reconciler.production.min.js (NODE_PROD)": {
200
"size": 41103,
201
"gzip": 12766
202
},
203
"react-call-return.development.js (NODE_DEV)": {
204
- "size": 2700,
205
- "gzip": 937
204
+ "size": 2915,
205
+ "gzip": 944
206
},
207
"react-call-return.production.min.js (NODE_PROD)": {
208
"size": 845,
yarn.lock
+30
-18
@@ -37,7 +37,7 @@ acorn@^3.0.4:
37
version "3.3.0"
38
resolved "https://registry.yarnpkg.com/acorn/-/acorn-3.3.0.tgz#45e37fb39e8da3f25baee3ff5369e2bb5f22017a"
39
40
-acorn@^4.0.1, acorn@^4.0.3, acorn@^4.0.4:
40
+acorn@^4.0.3, acorn@^4.0.4:
41
version "4.0.11"
42
resolved "https://registry.yarnpkg.com/acorn/-/acorn-4.0.11.tgz#edcda3bd937e7556410d42ed5860f67399c794c0"
43
@@ -45,6 +45,10 @@ acorn@^5.0.1:
45
version "5.0.3"
46
resolved "https://registry.yarnpkg.com/acorn/-/acorn-5.0.3.tgz#c460df08491463f028ccb82eab3730bf01087b3d"
47
48
+acorn@^5.2.1:
49
+ version "5.2.1"
50
+ resolved "https://registry.yarnpkg.com/acorn/-/acorn-5.2.1.tgz#317ac7821826c22c702d66189ab8359675f135d7"
51
+
52
ajv-keywords@^1.0.0:
53
version "1.5.1"
54
resolved "https://registry.yarnpkg.com/ajv-keywords/-/ajv-keywords-1.5.1.tgz#314dd0a4b3368fad3dfcdc54ede6171b886daf3c"
@@ -1732,6 +1736,10 @@ estree-walker@^0.3.0:
1736
version "0.3.1"
1737
resolved "https://registry.yarnpkg.com/estree-walker/-/estree-walker-0.3.1.tgz#e6b1a51cf7292524e7237c312e5fe6660c1ce1aa"
1738
1739
+estree-walker@^0.5.0:
1740
+ version "0.5.0"
1741
+ resolved "https://registry.yarnpkg.com/estree-walker/-/estree-walker-0.5.0.tgz#aae3b57c42deb8010e349c892462f0e71c5dd1aa"
1742
+
1743
esutils@2.0.2, esutils@^2.0.0, esutils@^2.0.2:
1744
version "2.0.2"
1745
resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.2.tgz#0abf4f1caa5bcb1f7a9d8acc6dea4faaa04bac9b"
@@ -3246,9 +3254,9 @@ magic-string@^0.16.0:
3254
dependencies:
3255
vlq "^0.2.1"
3256
3249
-magic-string@^0.19.0:
3250
- version "0.19.0"
3251
- resolved "https://registry.yarnpkg.com/magic-string/-/magic-string-0.19.0.tgz#198948217254e3e0b93080e01146b7c73b2a06b2"
3257
+magic-string@^0.22.4:
3258
+ version "0.22.4"
3259
+ resolved "https://registry.yarnpkg.com/magic-string/-/magic-string-0.22.4.tgz#31039b4e40366395618c1d6cf8193c53917475ff"
3260
dependencies:
3261
vlq "^0.2.1"
3262
@@ -4062,12 +4070,18 @@ resolve@1.1.7:
4070
version "1.1.7"
4071
resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.1.7.tgz#203114d82ad2c5ed9e8e0411b3932875e889e97b"
4072
4065
-resolve@^1.1.6, resolve@^1.1.7:
4073
+resolve@^1.1.6:
4074
version "1.3.3"
4075
resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.3.3.tgz#655907c3469a8680dc2de3a275a8fdd69691f0e5"
4076
dependencies:
4077
path-parse "^1.0.5"
4078
4079
+resolve@^1.4.0:
4080
+ version "1.5.0"
4081
+ resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.5.0.tgz#1f09acce796c9a762579f31b2c1cc4c3cddf9f36"
4082
+ dependencies:
4083
+ path-parse "^1.0.5"
4084
+
4085
restore-cursor@^1.0.1:
4086
version "1.0.1"
4087
resolved "https://registry.yarnpkg.com/restore-cursor/-/restore-cursor-1.0.1.tgz#34661f46886327fed2991479152252df92daa541"
@@ -4114,14 +4128,14 @@ rollup-plugin-closure-compiler-js@^1.0.4:
4128
dependencies:
4129
google-closure-compiler-js ">20170000"
4130
4117
-rollup-plugin-commonjs@^8.0.2:
4118
- version "8.0.2"
4119
- resolved "https://registry.yarnpkg.com/rollup-plugin-commonjs/-/rollup-plugin-commonjs-8.0.2.tgz#98b1589bfe32a6c0f67790b60c0b499972afed89"
4131
+rollup-plugin-commonjs@^8.2.6:
4132
+ version "8.2.6"
4133
+ resolved "https://registry.yarnpkg.com/rollup-plugin-commonjs/-/rollup-plugin-commonjs-8.2.6.tgz#27e5b9069ff94005bb01e01bb46a1e4873784677"
4134
dependencies:
4121
- acorn "^4.0.1"
4122
- estree-walker "^0.3.0"
4123
- magic-string "^0.19.0"
4124
- resolve "^1.1.7"
4135
+ acorn "^5.2.1"
4136
+ estree-walker "^0.5.0"
4137
+ magic-string "^0.22.4"
4138
+ resolve "^1.4.0"
4139
rollup-pluginutils "^2.0.1"
4140
4141
rollup-plugin-inject@^2.0.0:
@@ -4169,11 +4183,9 @@ rollup-pluginutils@^2.0.1:
4183
estree-walker "^0.3.0"
4184
micromatch "^2.3.11"
4185
4172
-rollup@^0.41.6:
4173
- version "0.41.6"
4174
- resolved "https://registry.yarnpkg.com/rollup/-/rollup-0.41.6.tgz#e0d05497877a398c104d816d2733a718a7a94e2a"
4175
- dependencies:
4176
- source-map-support "^0.4.0"
4186
+rollup@^0.49.3:
4187
+ version "0.49.3"
4188
+ resolved "https://registry.yarnpkg.com/rollup/-/rollup-0.49.3.tgz#4cce32643dd8cf2154c69ff0e43470067db0adbf"
4189
4190
run-async@^0.1.0:
4191
version "0.1.0"
@@ -4288,7 +4300,7 @@ source-map-support@^0.2.10:
4300
dependencies:
4301
source-map "0.1.32"
4302
4291
-source-map-support@^0.4.0, source-map-support@^0.4.2:
4303
+source-map-support@^0.4.2:
4304
version "0.4.14"
4305
resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.4.14.tgz#9d4463772598b86271b4f523f6c1f4e02a7d6aef"
4306
dependencies: