Skip to content

Commit 7c0aca2

Browse files
authored
Rollup freeze: false (facebook#12879)
* Tell Rollup not to freeze bundles * Only freeze bundles for DEV builds
1 parent 33289b5 commit 7c0aca2

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

scripts/rollup/build.js

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,13 +122,22 @@ function getBabelConfig(updateBabelOptions, bundleType, filename) {
122122
}
123123
}
124124

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+
126134
return Object.assign(
127135
{},
128136
{
129137
file: outputPath,
130138
format,
131139
globals,
140+
freeze: !isProduction,
132141
interop: false,
133142
name: globalName,
134143
sourcemap: false,
@@ -401,7 +410,8 @@ async function createBundle(bundle, bundleType) {
401410
mainOutputPath,
402411
format,
403412
peerGlobals,
404-
bundle.global
413+
bundle.global,
414+
bundleType
405415
);
406416

407417
console.log(`${chalk.bgYellow.black(' BUILDING ')} ${logKey}`);

0 commit comments

Comments
 (0)