Home / Function/ shouldSkipBundle() — react Function Reference

shouldSkipBundle() — react Function Reference

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

Entity Profile

Dependency Diagram

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

Relationship Graph

Source Code

scripts/rollup/build.js lines 548–583

function shouldSkipBundle(bundle, bundleType) {
  const shouldSkipBundleType = bundle.bundleTypes.indexOf(bundleType) === -1;
  if (shouldSkipBundleType) {
    return true;
  }
  if (requestedBundleTypes.length > 0) {
    const hasRequestedBundleType = requestedBundleTypes.some(requestedType =>
      bundleType.includes(requestedType)
    );
    if (!hasRequestedBundleType) {
      return true;
    }
  }
  if (requestedBundleNames.length > 0) {
    // If the name ends with `something/index` we only match if the
    // entry ends in something. Such as `react-dom/index` only matches
    // `react-dom` but not `react-dom/server`. Everything else is fuzzy
    // search.
    const entryLowerCase = bundle.entry.toLowerCase() + '/index.js';
    const isAskingForDifferentNames = requestedBundleNames.every(
      requestedName => {
        const matchEntry = entryLowerCase.indexOf(requestedName) !== -1;
        if (!bundle.name) {
          return !matchEntry;
        }
        const matchName =
          bundle.name.toLowerCase().indexOf(requestedName) !== -1;
        return !matchEntry && !matchName;
      }
    );
    if (isAskingForDifferentNames) {
      return true;
    }
  }
  return false;
}

Domain

Subdomains

Called By

Frequently Asked Questions

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

Analyze Your Own Codebase

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

Try Supermodel Free