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

Function shouldSkipBundle

scripts/rollup/build.js:548–583  ·  view source on GitHub ↗
(bundle, bundleType)

Source from the content-addressed store, hash-verified

546}
547
548function shouldSkipBundle(bundle, bundleType) {
549 const shouldSkipBundleType = bundle.bundleTypes.indexOf(bundleType) === -1;
550 if (shouldSkipBundleType) {
551 return true;
552 }
553 if (requestedBundleTypes.length > 0) {
554 const hasRequestedBundleType = requestedBundleTypes.some(requestedType =>
555 bundleType.includes(requestedType)
556 );
557 if (!hasRequestedBundleType) {
558 return true;
559 }
560 }
561 if (requestedBundleNames.length > 0) {
562 // If the name ends with `something/index` we only match if the
563 // entry ends in something. Such as `react-dom/index` only matches
564 // `react-dom` but not `react-dom/server`. Everything else is fuzzy
565 // search.
566 const entryLowerCase = bundle.entry.toLowerCase() + '/index.js';
567 const isAskingForDifferentNames = requestedBundleNames.every(
568 requestedName => {
569 const matchEntry = entryLowerCase.indexOf(requestedName) !== -1;
570 if (!bundle.name) {
571 return !matchEntry;
572 }
573 const matchName =
574 bundle.name.toLowerCase().indexOf(requestedName) !== -1;
575 return !matchEntry && !matchName;
576 }
577 );
578 if (isAskingForDifferentNames) {
579 return true;
580 }
581 }
582 return false;
583}
584
585function resolveEntryFork(resolvedEntry, isFBBundle, isDev) {
586 // Pick which entry point fork to use:

Callers 1

buildEverythingFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected