Home / Function/ buildEverything() — react Function Reference

buildEverything() — react Function Reference

Architecture documentation for the buildEverything() function in build.js from the react codebase.

Entity Profile

Dependency Diagram

graph TD
  4d4ca0d3_eb09_0168_db5f_50c3bfd22818["buildEverything()"]
  c80a1a72_0983_3915_42ad_1026a11c0a09["build.js"]
  4d4ca0d3_eb09_0168_db5f_50c3bfd22818 -->|defined in| c80a1a72_0983_3915_42ad_1026a11c0a09
  acf059b9_fb35_8aab_9761_0eba7a75b6d7["shouldSkipBundle()"]
  4d4ca0d3_eb09_0168_db5f_50c3bfd22818 -->|calls| acf059b9_fb35_8aab_9761_0eba7a75b6d7
  28cd04f7_2b38_5b97_3ce3_f39ee59d98ff["runShellCommand()"]
  4d4ca0d3_eb09_0168_db5f_50c3bfd22818 -->|calls| 28cd04f7_2b38_5b97_3ce3_f39ee59d98ff
  bb9629f0_8ad3_5155_4bf4_2cb0aa60d724["createBundle()"]
  4d4ca0d3_eb09_0168_db5f_50c3bfd22818 -->|calls| bb9629f0_8ad3_5155_4bf4_2cb0aa60d724
  style 4d4ca0d3_eb09_0168_db5f_50c3bfd22818 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

scripts/rollup/build.js lines 828–894

async function buildEverything() {
  if (!argv['unsafe-partial']) {
    await asyncRimRaf('build');
  }

  // Run them serially for better console output
  // and to avoid any potential race conditions.

  let bundles = [];
  // eslint-disable-next-line no-for-of-loops/no-for-of-loops
  for (const bundle of Bundles.bundles) {
    bundles.push(
      [bundle, NODE_ES2015],
      [bundle, ESM_DEV],
      [bundle, ESM_PROD],
      [bundle, NODE_DEV],
      [bundle, NODE_PROD],
      [bundle, NODE_PROFILING],
      [bundle, BUN_DEV],
      [bundle, BUN_PROD],
      [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],
      [bundle, BROWSER_SCRIPT],
      [bundle, CJS_DTS],
      [bundle, ESM_DTS]
    );
  }

  bundles = bundles.filter(([bundle, bundleType]) => {
    return !shouldSkipBundle(bundle, bundleType);
  });

  if (process.env.CI_TOTAL && process.env.CI_INDEX) {
    const nodeTotal = parseInt(process.env.CI_TOTAL, 10);
    const nodeIndex = parseInt(process.env.CI_INDEX, 10);
    bundles = bundles.filter((_, i) => i % nodeTotal === nodeIndex);
  }

  // eslint-disable-next-line no-for-of-loops/no-for-of-loops
  for (const [bundle, bundleType] of bundles) {
    if (bundle.prebuild) {
      runShellCommand(bundle.prebuild);
    }
    await createBundle(bundle, bundleType);
  }

  await Packaging.copyAllShims();
  await Packaging.prepareNpmPackages();

  if (syncFBSourcePath) {
    await Sync.syncReactNative(syncFBSourcePath);
  } else if (syncWWWPath) {
    await Sync.syncReactDom('build/facebook-www', syncWWWPath);
  }

  console.log(Stats.printResults());
  if (!forcePrettyOutput) {
    Stats.saveResults();
  }
}

Domain

Subdomains

Frequently Asked Questions

What does buildEverything() do?
buildEverything() is a function in the react codebase, defined in scripts/rollup/build.js.
Where is buildEverything() defined?
buildEverything() is defined in scripts/rollup/build.js at line 828.
What does buildEverything() call?
buildEverything() calls 3 function(s): createBundle, runShellCommand, shouldSkipBundle.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free