Home / Function/ resolveEntryFork() — react Function Reference

resolveEntryFork() — react Function Reference

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

Entity Profile

Dependency Diagram

graph TD
  ccd7a40e_e94d_8b85_bfcc_dd55c611c9a9["resolveEntryFork()"]
  c80a1a72_0983_3915_42ad_1026a11c0a09["build.js"]
  ccd7a40e_e94d_8b85_bfcc_dd55c611c9a9 -->|defined in| c80a1a72_0983_3915_42ad_1026a11c0a09
  bb9629f0_8ad3_5155_4bf4_2cb0aa60d724["createBundle()"]
  bb9629f0_8ad3_5155_4bf4_2cb0aa60d724 -->|calls| ccd7a40e_e94d_8b85_bfcc_dd55c611c9a9
  style ccd7a40e_e94d_8b85_bfcc_dd55c611c9a9 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

scripts/rollup/build.js lines 585–633

function resolveEntryFork(resolvedEntry, isFBBundle, isDev) {
  // Pick which entry point fork to use:
  // .modern.fb.js
  // .classic.fb.js
  // .fb.js
  // .stable.js
  // .experimental.js
  // .js
  // or any of those plus .development.js

  if (isFBBundle) {
    const resolvedFBEntry = resolvedEntry.replace(
      '.js',
      __EXPERIMENTAL__ ? '.modern.fb.js' : '.classic.fb.js'
    );
    const devFBEntry = resolvedFBEntry.replace('.js', '.development.js');
    if (isDev && fs.existsSync(devFBEntry)) {
      return devFBEntry;
    }
    if (fs.existsSync(resolvedFBEntry)) {
      return resolvedFBEntry;
    }
    const resolvedGenericFBEntry = resolvedEntry.replace('.js', '.fb.js');
    const devGenericFBEntry = resolvedGenericFBEntry.replace(
      '.js',
      '.development.js'
    );
    if (isDev && fs.existsSync(devGenericFBEntry)) {
      return devGenericFBEntry;
    }
    if (fs.existsSync(resolvedGenericFBEntry)) {
      return resolvedGenericFBEntry;
    }
    // Even if it's a FB bundle we fallthrough to pick stable or experimental if we don't have an FB fork.
  }
  const resolvedForkedEntry = resolvedEntry.replace(
    '.js',
    __EXPERIMENTAL__ ? '.experimental.js' : '.stable.js'
  );
  const devForkedEntry = resolvedForkedEntry.replace('.js', '.development.js');
  if (isDev && fs.existsSync(devForkedEntry)) {
    return devForkedEntry;
  }
  if (fs.existsSync(resolvedForkedEntry)) {
    return resolvedForkedEntry;
  }
  // Just use the plain .js one.
  return resolvedEntry;
}

Domain

Subdomains

Called By

Frequently Asked Questions

What does resolveEntryFork() do?
resolveEntryFork() is a function in the react codebase, defined in scripts/rollup/build.js.
Where is resolveEntryFork() defined?
resolveEntryFork() is defined in scripts/rollup/build.js at line 585.
What calls resolveEntryFork()?
resolveEntryFork() is called by 1 function(s): createBundle.

Analyze Your Own Codebase

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

Try Supermodel Free