diff options
-rw-r--r-- | .changeset/loud-penguins-tickle.md | 5 | ||||
-rw-r--r-- | packages/astro/src/core/build/css-asset-name.ts | 3 |
2 files changed, 7 insertions, 1 deletions
diff --git a/.changeset/loud-penguins-tickle.md b/.changeset/loud-penguins-tickle.md new file mode 100644 index 000000000..1076db0d3 --- /dev/null +++ b/.changeset/loud-penguins-tickle.md @@ -0,0 +1,5 @@ +--- +'astro': patch +--- + +Fix: https://github.com/withastro/astro/issues/5400 diff --git a/packages/astro/src/core/build/css-asset-name.ts b/packages/astro/src/core/build/css-asset-name.ts index 225dd12aa..c9e4a418e 100644 --- a/packages/astro/src/core/build/css-asset-name.ts +++ b/packages/astro/src/core/build/css-asset-name.ts @@ -25,6 +25,7 @@ export function shortHashedName(id: string, ctx: { getModuleInfo: GetModuleInfo export function createSlugger(settings: AstroSettings) { const pagesDir = viteID(new URL('./pages', settings.config.srcDir)); + const indexPage = viteID(new URL("./pages/index", settings.config.srcDir)); const map = new Map<string, Map<string, number>>(); const sep = '-'; return function (id: string, ctx: { getModuleInfo: GetModuleInfo }): string { @@ -33,7 +34,7 @@ export function createSlugger(settings: AstroSettings) { .map(([page]) => page.id) .sort() .join('-'); - const firstParentId = parents[0]?.[0].id || 'index'; + const firstParentId = parents[0]?.[0].id || indexPage; // Use the last two segments, for ex /docs/index let dir = firstParentId; |