From 161b9426e42d13da5cb1bc25937192f34871ac2a Mon Sep 17 00:00:00 2001 From: arx-ein Date: Fri, 17 Apr 2026 18:07:05 +0900 Subject: [PATCH] Fix path resolution while building on Windows --- integrations/redirect.ts | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/integrations/redirect.ts b/integrations/redirect.ts index 700f2d03d4..2a1b25c027 100644 --- a/integrations/redirect.ts +++ b/integrations/redirect.ts @@ -30,10 +30,9 @@ export default function redirect(): AstroIntegration { const { redirect_to, redirect_from } = file.data; const here = "/" + - relative(pages, file.path).replace( - /(?:index)?\.(?:md|mdx|markdown|astro)$/, - "", - ); + relative(pages, file.path) + .replace(/\\/g, "/") + .replace(/(?:index)?\.(?:md|mdx|markdown|astro)$/, ""); if (typeof redirect_to === "string") { return { from: here, to: redirect_to }; }