Skip to content

Commit b895113

Browse files
fix(assets): bundling regression for specific config on non-Node runtimes (#9087)
1 parent 554017b commit b895113

2 files changed

Lines changed: 10 additions & 1 deletion

File tree

.changeset/red-houses-explode.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+
Fixes the regression which broke bundling of image service for pre-rendered pages, which was introduced by [#8854](https://github.com/withastro/astro/pull/8854)

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,11 @@ function vitePluginPrerender(opts: StaticBuildOptions, internals: BuildInternals
1212

1313
outputOptions(outputOptions) {
1414
extendManualChunks(outputOptions, {
15-
before(id, meta) {
15+
after(id, meta) {
16+
// Split the Astro runtime into a separate chunk for readability
17+
if (id.includes('astro/dist/runtime')) {
18+
return 'astro';
19+
}
1620
const pageInfo = internals.pagesByViteID.get(id);
1721
if (pageInfo) {
1822
// prerendered pages should be split into their own chunk

0 commit comments

Comments
 (0)