Skip to content

Commit 7f4c07d

Browse files
committed
Don't build non-experimental www bundles
Reduces the likelihood we'll accidentally sync the wrong ones.
1 parent 0b61e26 commit 7f4c07d

File tree

1 file changed

+14
-10
lines changed

1 file changed

+14
-10
lines changed

scripts/rollup/build.js

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ const {asyncCopyTo, asyncRimRaf} = require('./utils');
2525
const codeFrame = require('babel-code-frame');
2626
const Wrappers = require('./wrappers');
2727

28+
const __EXPERIMENTAL__ = process.env.RELEASE_CHANNEL === 'experimental';
29+
2830
// Errors in promises should be fatal.
2931
let loggedErrors = new Set();
3032
process.on('unhandledRejection', err => {
@@ -304,8 +306,7 @@ function getPlugins(
304306
bundleType,
305307
globalName,
306308
moduleType,
307-
pureExternalModules,
308-
isExperimentalBuild
309+
pureExternalModules
309310
) {
310311
const findAndRecordErrorCodes = extractErrorCodes(errorCodeOpts);
311312
const forks = Modules.getForks(bundleType, entry, moduleType);
@@ -363,7 +364,7 @@ function getPlugins(
363364
__PROFILE__: isProfiling || !isProduction ? 'true' : 'false',
364365
__UMD__: isUMDBundle ? 'true' : 'false',
365366
'process.env.NODE_ENV': isProduction ? "'production'" : "'development'",
366-
__EXPERIMENTAL__: isExperimentalBuild,
367+
__EXPERIMENTAL__,
367368
}),
368369
// We still need CommonJS for external deps like object-assign.
369370
commonjs(),
@@ -487,8 +488,6 @@ async function createBundle(bundle, bundleType) {
487488
module => !importSideEffects[module]
488489
);
489490

490-
const isExperimentalBuild = process.env.RELEASE_CHANNEL === 'experimental';
491-
492491
const rollupConfig = {
493492
input: resolvedEntry,
494493
treeshake: {
@@ -512,8 +511,7 @@ async function createBundle(bundle, bundleType) {
512511
bundleType,
513512
bundle.global,
514513
bundle.moduleType,
515-
pureExternalModules,
516-
isExperimentalBuild
514+
pureExternalModules
517515
),
518516
// We can't use getters in www.
519517
legacy:
@@ -656,16 +654,22 @@ async function buildEverything() {
656654
[bundle, NODE_DEV],
657655
[bundle, NODE_PROD],
658656
[bundle, NODE_PROFILING],
659-
[bundle, FB_WWW_DEV],
660-
[bundle, FB_WWW_PROD],
661-
[bundle, FB_WWW_PROFILING],
662657
[bundle, RN_OSS_DEV],
663658
[bundle, RN_OSS_PROD],
664659
[bundle, RN_OSS_PROFILING],
665660
[bundle, RN_FB_DEV],
666661
[bundle, RN_FB_PROD],
667662
[bundle, RN_FB_PROFILING]
668663
);
664+
665+
if (__EXPERIMENTAL__) {
666+
// www uses experimental builds only.
667+
bundles.push(
668+
[bundle, FB_WWW_DEV],
669+
[bundle, FB_WWW_PROD],
670+
[bundle, FB_WWW_PROFILING]
671+
);
672+
}
669673
}
670674

671675
if (!shouldExtractErrors && process.env.CIRCLE_NODE_TOTAL) {

0 commit comments

Comments
 (0)