Home / Function/ runHookRouteSetup() — astro Function Reference

runHookRouteSetup() — astro Function Reference

Architecture documentation for the runHookRouteSetup() function in hooks.ts from the astro codebase.

Entity Profile

Dependency Diagram

graph TD
  8c3ff101_ae7b_f043_be60_9202e6bb8d5f["runHookRouteSetup()"]
  19f4084c_157f_a15d_f001_5d8088b75dee["hooks.ts"]
  8c3ff101_ae7b_f043_be60_9202e6bb8d5f -->|defined in| 19f4084c_157f_a15d_f001_5d8088b75dee
  1e1ca282_3771_2cb3_ede6_ff5ab0d382fa["runHookInternal()"]
  8c3ff101_ae7b_f043_be60_9202e6bb8d5f -->|calls| 1e1ca282_3771_2cb3_ede6_ff5ab0d382fa
  style 8c3ff101_ae7b_f043_be60_9202e6bb8d5f fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/astro/src/integrations/hooks.ts lines 628–659

export async function runHookRouteSetup({
	route,
	settings,
	logger,
}: {
	route: RouteOptions;
	settings: AstroSettings;
	logger: Logger;
}) {
	const prerenderChangeLogs: { integrationName: string; value: boolean | undefined }[] = [];

	for (const integration of settings.config.integrations) {
		const originalRoute = { ...route };
		await runHookInternal({
			integration,
			hookName: 'astro:route:setup',
			logger,
			params: () => ({ route }),
		});
		if (route.prerender !== originalRoute.prerender) {
			prerenderChangeLogs.push({ integrationName: integration.name, value: route.prerender });
		}
	}

	if (prerenderChangeLogs.length > 1) {
		logger.debug(
			'router',
			`The ${route.component} route's prerender option has been changed multiple times by integrations:\n` +
				prerenderChangeLogs.map((log) => `- ${log.integrationName}: ${log.value}`).join('\n'),
		);
	}
}

Domain

Subdomains

Frequently Asked Questions

What does runHookRouteSetup() do?
runHookRouteSetup() is a function in the astro codebase, defined in packages/astro/src/integrations/hooks.ts.
Where is runHookRouteSetup() defined?
runHookRouteSetup() is defined in packages/astro/src/integrations/hooks.ts at line 628.
What does runHookRouteSetup() call?
runHookRouteSetup() calls 1 function(s): runHookInternal.

Analyze Your Own Codebase

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

Try Supermodel Free