MCPcopy Index your code
hub / github.com/react/react / buildEverything

Function buildEverything

scripts/rollup/build.js:828–894  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

826}
827
828async function buildEverything() {
829 if (!argv['unsafe-partial']) {
830 await asyncRimRaf('build');
831 }
832
833 // Run them serially for better console output
834 // and to avoid any potential race conditions.
835
836 let bundles = [];
837 // eslint-disable-next-line no-for-of-loops/no-for-of-loops
838 for (const bundle of Bundles.bundles) {
839 bundles.push(
840 [bundle, NODE_ES2015],
841 [bundle, ESM_DEV],
842 [bundle, ESM_PROD],
843 [bundle, NODE_DEV],
844 [bundle, NODE_PROD],
845 [bundle, NODE_PROFILING],
846 [bundle, BUN_DEV],
847 [bundle, BUN_PROD],
848 [bundle, FB_WWW_DEV],
849 [bundle, FB_WWW_PROD],
850 [bundle, FB_WWW_PROFILING],
851 [bundle, RN_OSS_DEV],
852 [bundle, RN_OSS_PROD],
853 [bundle, RN_OSS_PROFILING],
854 [bundle, RN_FB_DEV],
855 [bundle, RN_FB_PROD],
856 [bundle, RN_FB_PROFILING],
857 [bundle, BROWSER_SCRIPT],
858 [bundle, CJS_DTS],
859 [bundle, ESM_DTS]
860 );
861 }
862
863 bundles = bundles.filter(([bundle, bundleType]) => {
864 return !shouldSkipBundle(bundle, bundleType);
865 });
866
867 if (process.env.CI_TOTAL && process.env.CI_INDEX) {
868 const nodeTotal = parseInt(process.env.CI_TOTAL, 10);
869 const nodeIndex = parseInt(process.env.CI_INDEX, 10);
870 bundles = bundles.filter((_, i) => i % nodeTotal === nodeIndex);
871 }
872
873 // eslint-disable-next-line no-for-of-loops/no-for-of-loops
874 for (const [bundle, bundleType] of bundles) {
875 if (bundle.prebuild) {
876 runShellCommand(bundle.prebuild);
877 }
878 await createBundle(bundle, bundleType);
879 }
880
881 await Packaging.copyAllShims();
882 await Packaging.prepareNpmPackages();
883
884 if (syncFBSourcePath) {
885 await Sync.syncReactNative(syncFBSourcePath);

Callers 1

build.jsFile · 0.85

Calls 5

asyncRimRafFunction · 0.85
shouldSkipBundleFunction · 0.85
runShellCommandFunction · 0.85
createBundleFunction · 0.85
pushMethod · 0.65

Tested by

no test coverage detected