Skip to content

Commit

Permalink
fix: image service bundling for pre-rendered pages regression
Browse files Browse the repository at this point in the history
  • Loading branch information
alexanderniebuhr committed Nov 13, 2023
1 parent 5ef89ef commit 6c3bd26
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/red-houses-explode.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'astro': patch
---

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)
6 changes: 5 additions & 1 deletion packages/astro/src/core/build/plugins/plugin-prerender.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,11 @@ function vitePluginPrerender(opts: StaticBuildOptions, internals: BuildInternals

outputOptions(outputOptions) {
extendManualChunks(outputOptions, {
before(id, meta) {
after(id, meta) {
// Split the Astro runtime into a separate chunk for readability
if (id.includes('astro/dist/runtime')) {
return 'astro';
}
const pageInfo = internals.pagesByViteID.get(id);
if (pageInfo) {
// prerendered pages should be split into their own chunk
Expand Down

0 comments on commit 6c3bd26

Please sign in to comment.