MCPcopy
hub / github.com/rollup/rollup / handleExistingModule

Method handleExistingModule

src/ModuleLoader.ts:649–667  ·  view source on GitHub ↗
(module: Module, isEntry: boolean, isPreload: PreloadType)

Source from the content-addressed store, hash-verified

647 }
648
649 private async handleExistingModule(module: Module, isEntry: boolean, isPreload: PreloadType) {
650 const loadPromise = this.moduleLoadPromises.get(module)!;
651 if (isPreload) {
652 return isPreload === RESOLVE_DEPENDENCIES
653 ? waitForDependencyResolution(loadPromise)
654 : loadPromise;
655 }
656 if (isEntry) {
657 // This reverts the changes in addEntryWithImplicitDependants and needs to
658 // be performed atomically
659 module.info.isEntry = true;
660 this.implicitEntryModules.delete(module);
661 for (const dependent of module.implicitlyLoadedAfter) {
662 dependent.implicitlyLoadedBefore.delete(module);
663 }
664 module.implicitlyLoadedAfter.clear();
665 }
666 return this.fetchModuleDependencies(module, ...(await loadPromise));
667 }
668
669 private handleInvalidResolvedId(
670 resolvedId: ResolvedId | null,

Callers 1

fetchModuleMethod · 0.95

Calls 4

getMethod · 0.80
deleteMethod · 0.80

Tested by

no test coverage detected