Skip to content

Commit 01f3f46

Browse files
authored
Fix order-of-execution bug when generating pages (#5822)
* fix: bundle all pages into a single chunk * chore: add changeset Co-authored-by: Nate Moore <nate@astro.build>
1 parent 23dc9ea commit 01f3f46

2 files changed

Lines changed: 7 additions & 2 deletions

File tree

.changeset/beige-beds-smile.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'astro': patch
3+
---
4+
5+
Fix edge case with bundle generation by emitting a single chunk for pages

packages/astro/src/core/build/vite-plugin-prerender.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ export function vitePluginPrerender(
3434
if (api.getModuleInfo(id)?.meta.astro?.pageOptions?.prerender) {
3535
return `prerender`;
3636
}
37-
// pages should go in their own chunks/pages/* directory
38-
return `pages${pageInfo.route.route.replace(/\/$/, '/index')}`;
37+
// dynamic pages should all go in their own chunk in the pages/* directory
38+
return `pages/all`;
3939
}
4040
};
4141
},

0 commit comments

Comments
 (0)