mirror of
https://github.com/zebrajr/react.git
synced 2026-01-15 12:15:22 +00:00
Don't build non-experimental www bundles (#17139)
Reduces the likelihood we'll accidentally sync the wrong ones.
This commit is contained in:
@@ -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 => {
|
||||
@@ -304,8 +306,7 @@ function getPlugins(
|
||||
bundleType,
|
||||
globalName,
|
||||
moduleType,
|
||||
pureExternalModules,
|
||||
isExperimentalBuild
|
||||
pureExternalModules
|
||||
) {
|
||||
const findAndRecordErrorCodes = extractErrorCodes(errorCodeOpts);
|
||||
const forks = Modules.getForks(bundleType, entry, moduleType);
|
||||
@@ -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(),
|
||||
@@ -487,8 +488,6 @@ async function createBundle(bundle, bundleType) {
|
||||
module => !importSideEffects[module]
|
||||
);
|
||||
|
||||
const isExperimentalBuild = process.env.RELEASE_CHANNEL === 'experimental';
|
||||
|
||||
const rollupConfig = {
|
||||
input: resolvedEntry,
|
||||
treeshake: {
|
||||
@@ -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:
|
||||
@@ -656,9 +654,6 @@ 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],
|
||||
@@ -666,6 +661,15 @@ async function buildEverything() {
|
||||
[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) {
|
||||
|
||||
@@ -54,10 +54,6 @@ function checkFilesExist(bundle) {
|
||||
}
|
||||
|
||||
const bundles = [
|
||||
{
|
||||
format: 'fb',
|
||||
filePatterns: [`./build/facebook-www/*.js`],
|
||||
},
|
||||
{
|
||||
format: 'rn',
|
||||
filePatterns: [`./build/react-native/implementations/*.js`],
|
||||
@@ -75,4 +71,11 @@ const bundles = [
|
||||
},
|
||||
];
|
||||
|
||||
if (process.env.RELEASE_CHANNEL === 'experimental') {
|
||||
bundles.push({
|
||||
format: 'fb',
|
||||
filePatterns: [`./build/facebook-www/*.js`],
|
||||
});
|
||||
}
|
||||
|
||||
bundles.map(checkFilesExist).map(lint);
|
||||
|
||||
Reference in New Issue
Block a user