Home / Function/ getContentRendererByViteId() — astro Function Reference

getContentRendererByViteId() — astro Function Reference

Architecture documentation for the getContentRendererByViteId() function in vite-plugin-content-imports.ts from the astro codebase.

Entity Profile

Dependency Diagram

graph TD
  cf9ce9b8_bf3a_bf89_be3d_c5390f14a54b["getContentRendererByViteId()"]
  157f6669_1b64_2b6d_ca39_b0f784c87ad2["vite-plugin-content-imports.ts"]
  cf9ce9b8_bf3a_bf89_be3d_c5390f14a54b -->|defined in| 157f6669_1b64_2b6d_ca39_b0f784c87ad2
  06cd4177_9728_08c0_fa43_2385e28cbaf4["astroContentImportPlugin()"]
  06cd4177_9728_08c0_fa43_2385e28cbaf4 -->|calls| cf9ce9b8_bf3a_bf89_be3d_c5390f14a54b
  style cf9ce9b8_bf3a_bf89_be3d_c5390f14a54b fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/astro/src/content/vite-plugin-content-imports.ts lines 40–55

function getContentRendererByViteId(
	viteId: string,
	settings: Pick<AstroSettings, 'contentEntryTypes'>,
): ContentEntryType['getRenderModule'] | undefined {
	let ext = viteId.split('.').pop();
	if (!ext) return undefined;
	for (const contentEntryType of settings.contentEntryTypes) {
		if (
			Boolean(contentEntryType.getRenderModule) &&
			contentEntryType.extensions.includes('.' + ext)
		) {
			return contentEntryType.getRenderModule;
		}
	}
	return undefined;
}

Subdomains

Frequently Asked Questions

What does getContentRendererByViteId() do?
getContentRendererByViteId() is a function in the astro codebase, defined in packages/astro/src/content/vite-plugin-content-imports.ts.
Where is getContentRendererByViteId() defined?
getContentRendererByViteId() is defined in packages/astro/src/content/vite-plugin-content-imports.ts at line 40.
What calls getContentRendererByViteId()?
getContentRendererByViteId() is called by 1 function(s): astroContentImportPlugin.

Analyze Your Own Codebase

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

Try Supermodel Free