Skip to content

Commit

Permalink
fix(assets): bundling regression for specific config on non-Node runt…
Browse files Browse the repository at this point in the history
…imes (#9087)
  • Loading branch information
alexanderniebuhr authored Nov 14, 2023
1 parent 554017b commit b895113
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 b895113

Please sign in to comment.