Home / Type/ ModuleLoader Type — astro Architecture

ModuleLoader Type — astro Architecture

Architecture documentation for the ModuleLoader type/interface in runner.ts from the astro codebase.

Entity Profile

Dependency Diagram

graph TD
  6cb851e1_6ce3_a713_295e_2212cf671055["ModuleLoader"]
  58abb67e_f385_ecd0_f6d1_c515d265bf85["runner.ts"]
  6cb851e1_6ce3_a713_295e_2212cf671055 -->|defined in| 58abb67e_f385_ecd0_f6d1_c515d265bf85
  style 6cb851e1_6ce3_a713_295e_2212cf671055 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/astro/src/core/module-loader/runner.ts lines 24–47

export interface ModuleLoader {
	import: (src: string) => Promise<Record<string, any>>;
	resolveId: (specifier: string, parentId: string | undefined) => Promise<string | undefined>;
	getModuleById: (id: string) => EnvironmentModuleNode | undefined;
	getModulesByFile: (file: string) => Set<EnvironmentModuleNode> | undefined;
	getModuleInfo: (id: string) => ModuleInfo | null;

	eachModule(
		callbackfn: (
			value: EnvironmentModuleNode,
			key: string,
			map: Map<string, EnvironmentModuleNode>,
		) => void,
	): void;
	invalidateModule(mod: EnvironmentModuleNode): void;

	fixStacktrace: (error: Error) => void;

	clientReload: () => void;
	webSocketSend: (msg: any) => void;
	isHttps: () => boolean;
	events: TypedEventEmitter<LoaderEvents>;
	getSSREnvironment: () => RunnableDevEnvironment;
}

Frequently Asked Questions

What is the ModuleLoader type?
ModuleLoader is a type/interface in the astro codebase, defined in packages/astro/src/core/module-loader/runner.ts.
Where is ModuleLoader defined?
ModuleLoader is defined in packages/astro/src/core/module-loader/runner.ts at line 24.

Analyze Your Own Codebase

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

Try Supermodel Free