Skip to content

Commit

Permalink
Don't build non-experimental www bundles
Browse files Browse the repository at this point in the history
Reduces the likelihood we'll accidentally sync the wrong ones.
  • Loading branch information
acdlite committed Oct 18, 2019
1 parent 0b61e26 commit 7f4c07d
Showing 1 changed file with 14 additions and 10 deletions.
24 changes: 14 additions & 10 deletions scripts/rollup/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ const {asyncCopyTo, asyncRimRaf} = require('./utils');
const codeFrame = require('babel-code-frame');
const Wrappers = require('./wrappers');

const __EXPERIMENTAL__ = process.env.RELEASE_CHANNEL === 'experimental';

// Errors in promises should be fatal.
let loggedErrors = new Set();
process.on('unhandledRejection', err => {
Expand Down Expand Up @@ -304,8 +306,7 @@ function getPlugins(
bundleType,
globalName,
moduleType,
pureExternalModules,
isExperimentalBuild
pureExternalModules
) {
const findAndRecordErrorCodes = extractErrorCodes(errorCodeOpts);
const forks = Modules.getForks(bundleType, entry, moduleType);
Expand Down Expand Up @@ -363,7 +364,7 @@ function getPlugins(
__PROFILE__: isProfiling || !isProduction ? 'true' : 'false',
__UMD__: isUMDBundle ? 'true' : 'false',
'process.env.NODE_ENV': isProduction ? "'production'" : "'development'",
__EXPERIMENTAL__: isExperimentalBuild,
__EXPERIMENTAL__,
}),
// We still need CommonJS for external deps like object-assign.
commonjs(),
Expand Down Expand Up @@ -487,8 +488,6 @@ async function createBundle(bundle, bundleType) {
module => !importSideEffects[module]
);

const isExperimentalBuild = process.env.RELEASE_CHANNEL === 'experimental';

const rollupConfig = {
input: resolvedEntry,
treeshake: {
Expand All @@ -512,8 +511,7 @@ async function createBundle(bundle, bundleType) {
bundleType,
bundle.global,
bundle.moduleType,
pureExternalModules,
isExperimentalBuild
pureExternalModules
),
// We can't use getters in www.
legacy:
Expand Down Expand Up @@ -656,16 +654,22 @@ async function buildEverything() {
[bundle, NODE_DEV],
[bundle, NODE_PROD],
[bundle, NODE_PROFILING],
[bundle, FB_WWW_DEV],
[bundle, FB_WWW_PROD],
[bundle, FB_WWW_PROFILING],
[bundle, RN_OSS_DEV],
[bundle, RN_OSS_PROD],
[bundle, RN_OSS_PROFILING],
[bundle, RN_FB_DEV],
[bundle, RN_FB_PROD],
[bundle, RN_FB_PROFILING]
);

if (__EXPERIMENTAL__) {
// www uses experimental builds only.
bundles.push(
[bundle, FB_WWW_DEV],
[bundle, FB_WWW_PROD],
[bundle, FB_WWW_PROFILING]
);
}
}

if (!shouldExtractErrors && process.env.CIRCLE_NODE_TOTAL) {
Expand Down

0 comments on commit 7f4c07d

Please sign in to comment.