Rollup freeze: false (#12879)
* Tell Rollup not to freeze bundles * Only freeze bundles for DEV builds
Brian Vaughn committed
May 22, 2018 at 08:16 UTC
7c0aca289d2ae6444e70753287602222701b1703
1 file changed
+12
-2
scripts/rollup/build.js
+12
-2
@@ -122,13 +122,22 @@ function getBabelConfig(updateBabelOptions, bundleType, filename) {
122
}
123
}
124
125
-function getRollupOutputOptions(outputPath, format, globals, globalName) {
125
+function getRollupOutputOptions(
126
+ outputPath,
127
+ format,
128
+ globals,
129
+ globalName,
130
+ bundleType
131
+) {
132
+ const isProduction = isProductionBundleType(bundleType);
133
+
134
return Object.assign(
135
{},
136
{
137
file: outputPath,
138
format,
139
globals,
140
+ freeze: !isProduction,
141
interop: false,
142
name: globalName,
143
sourcemap: false,
@@ -401,7 +410,8 @@ async function createBundle(bundle, bundleType) {
410
mainOutputPath,
411
format,
412
peerGlobals,
404
- bundle.global
413
+ bundle.global,
414
+ bundleType
415
);
416
417
console.log(`${chalk.bgYellow.black(' BUILDING ')} ${logKey}`);