From 07c685fee1f9ee83f60e501f2842d4773e19db75 Mon Sep 17 00:00:00 2001 From: Samuel Berthe Date: Fri, 10 Apr 2026 21:05:10 +0200 Subject: [PATCH] fix: resolve Astro build errors in astro.config.mjs - Remove assetsInclude yml which caused Vite to treat YAML files as static assets instead of running them through the custom YAML transform plugin; data.groups was undefined at runtime because the import resolved to a URL rather than parsed content - Deduplicate old-path redirects: emit only the slash-less variant per service to avoid Astro router collision warnings (trailing-slash variant is handled automatically) --- site/astro.config.mjs | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/site/astro.config.mjs b/site/astro.config.mjs index a2d86aa..d3cb79c 100644 --- a/site/astro.config.mjs +++ b/site/astro.config.mjs @@ -49,11 +49,10 @@ function buildRedirects(base) { // Old anchor slug (spaces → hyphens only, no other substitutions) const oldSlug = service.name.replace(/ /g, '-').toLowerCase(); const newPath = `${base}/rules/${groupSlug}/${serviceSlug}/`; - // Redirect from flat old path (with and without trailing slash) - for (const oldPath of [`${base}/rules/${oldSlug}`, `${base}/rules/${oldSlug}/`]) { - if (oldPath !== newPath && oldPath !== newPath.slice(0, -1)) { - redirects[oldPath] = { destination: newPath, status: 301 }; - } + // Redirect from flat old path (without trailing slash; Astro handles the slash variant) + const oldPath = `${base}/rules/${oldSlug}`; + if (oldPath !== newPath && oldPath !== newPath.slice(0, -1)) { + redirects[oldPath] = { destination: newPath, status: 301 }; } } } @@ -102,6 +101,5 @@ export default defineConfig({ ], vite: { plugins: [yamlPlugin()], - assetsInclude: ['**/*.yml'], }, });