MCPcopy
hub / github.com/rollup/rollup / loadEntryModule

Method loadEntryModule

src/ModuleLoader.ts:695–744  ·  view source on GitHub ↗
(
		unresolvedId: string,
		isEntry: boolean,
		importer: string | undefined,
		implicitlyLoadedBefore: string | null,
		isLoadForManualChunks = false,
		importerAttributes: Record<string, string> | undefined
	)

Source from the content-addressed store, hash-verified

693 }
694
695 private async loadEntryModule(
696 unresolvedId: string,
697 isEntry: boolean,
698 importer: string | undefined,
699 implicitlyLoadedBefore: string | null,
700 isLoadForManualChunks = false,
701 importerAttributes: Record<string, string> | undefined
702 ): Promise<Module> {
703 const resolveIdResult = await resolveId(
704 unresolvedId,
705 importer,
706 this.options.preserveSymlinks,
707 this.pluginDriver,
708 this.resolveId,
709 null,
710 EMPTY_OBJECT,
711 true,
712 EMPTY_OBJECT,
713 importerAttributes,
714 this.options.fs
715 );
716 if (resolveIdResult == null) {
717 return error(
718 implicitlyLoadedBefore === null
719 ? logUnresolvedEntry(unresolvedId)
720 : logUnresolvedImplicitDependant(unresolvedId, implicitlyLoadedBefore)
721 );
722 }
723 const isExternalModules = typeof resolveIdResult === 'object' && resolveIdResult.external;
724 if (resolveIdResult === false || isExternalModules) {
725 return error(
726 implicitlyLoadedBefore === null
727 ? isExternalModules && isLoadForManualChunks
728 ? logExternalModulesCannotBeIncludedInManualChunks(unresolvedId)
729 : logEntryCannotBeExternal(unresolvedId)
730 : logImplicitDependantCannotBeExternal(unresolvedId, implicitlyLoadedBefore)
731 );
732 }
733 return this.fetchModule(
734 this.getResolvedIdWithDefaults(
735 typeof resolveIdResult === 'object'
736 ? (resolveIdResult as NormalizedResolveIdWithoutDefaults)
737 : { id: resolveIdResult },
738 EMPTY_OBJECT
739 )!,
740 undefined,
741 isEntry,
742 false
743 );
744 }
745
746 private async resolveDynamicImport(
747 module: Module,

Callers 3

addAdditionalModulesMethod · 0.95
addEntryModulesMethod · 0.95

Calls 9

fetchModuleMethod · 0.95
resolveIdFunction · 0.90
errorFunction · 0.90
logUnresolvedEntryFunction · 0.90
logEntryCannotBeExternalFunction · 0.90

Tested by

no test coverage detected