diff --git a/packages/astro/src/integrations/hooks.ts b/packages/astro/src/integrations/hooks.ts index 10c5af835d582..12aa17ae1e127 100644 --- a/packages/astro/src/integrations/hooks.ts +++ b/packages/astro/src/integrations/hooks.ts @@ -637,7 +637,7 @@ function toIntegrationRouteData(route: RouteData): IntegrationRouteData { segments: route.segments, prerender: route.prerender, redirect: route.redirect, - redirectRoute: route.redirectRoute, + redirectRoute: route.redirectRoute ? toIntegrationRouteData(route.redirectRoute) : undefined, type: route.type, pattern: route.pattern, distURL: route.distURL, diff --git a/packages/astro/src/types/public/integrations.ts b/packages/astro/src/types/public/integrations.ts index abfaea7e3e0b6..559ee38aa3251 100644 --- a/packages/astro/src/types/public/integrations.ts +++ b/packages/astro/src/types/public/integrations.ts @@ -243,4 +243,9 @@ export interface AstroIntegration { /** * A smaller version of the {@link RouteData} that is used in the integrations. */ -export type IntegrationRouteData = Omit; +export type IntegrationRouteData = Omit & { + /** + * {@link RouteData.redirectRoute} + */ + redirectRoute?: IntegrationRouteData +};