Home / Function/ getComponentMetadata() — astro Function Reference

getComponentMetadata() — astro Function Reference

Architecture documentation for the getComponentMetadata() function in metadata.ts from the astro codebase.

Entity Profile

Dependency Diagram

graph TD
  b4410057_c904_924b_48be_2bde8bf14ae9["getComponentMetadata()"]
  f143fda5_8882_f73d_ef43_7e22c35534a3["metadata.ts"]
  b4410057_c904_924b_48be_2bde8bf14ae9 -->|defined in| f143fda5_8882_f73d_ef43_7e22c35534a3
  cc2f070e_17d4_16a4_06d6_b896d1c4ab12["addMetadata()"]
  b4410057_c904_924b_48be_2bde8bf14ae9 -->|calls| cc2f070e_17d4_16a4_06d6_b896d1c4ab12
  style b4410057_c904_924b_48be_2bde8bf14ae9 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/astro/src/vite-plugin-astro-server/metadata.ts lines 7–23

export async function getComponentMetadata(
	filePath: URL,
	loader: ModuleLoader,
): Promise<SSRResult['componentMetadata']> {
	const map: SSRResult['componentMetadata'] = new Map();

	const rootID = viteID(filePath);
	addMetadata(map, loader.getModuleInfo(rootID));
	for await (const moduleNode of crawlGraph(loader.getSSREnvironment(), rootID, true)) {
		const id = moduleNode.id;
		if (id) {
			addMetadata(map, loader.getModuleInfo(id));
		}
	}

	return map;
}

Domain

Subdomains

Frequently Asked Questions

What does getComponentMetadata() do?
getComponentMetadata() is a function in the astro codebase, defined in packages/astro/src/vite-plugin-astro-server/metadata.ts.
Where is getComponentMetadata() defined?
getComponentMetadata() is defined in packages/astro/src/vite-plugin-astro-server/metadata.ts at line 7.
What does getComponentMetadata() call?
getComponentMetadata() calls 1 function(s): addMetadata.

Analyze Your Own Codebase

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

Try Supermodel Free