diff options
author | 2023-11-14 07:53:14 +0100 | |
---|---|---|
committer | 2023-11-14 07:53:14 +0100 | |
commit | b895113a0ae347ecd81bd8866ae2d816ea20836b (patch) | |
tree | 00e9b25541969d3019a16d66a450ec5474dd57b8 | |
parent | 554017b66ac139a422eb1c2a128c519de8945116 (diff) | |
download | astro-b895113a0ae347ecd81bd8866ae2d816ea20836b.tar.gz astro-b895113a0ae347ecd81bd8866ae2d816ea20836b.tar.zst astro-b895113a0ae347ecd81bd8866ae2d816ea20836b.zip |
fix(assets): bundling regression for specific config on non-Node runtimes (#9087)
-rw-r--r-- | .changeset/red-houses-explode.md | 5 | ||||
-rw-r--r-- | packages/astro/src/core/build/plugins/plugin-prerender.ts | 6 |
2 files changed, 10 insertions, 1 deletions
diff --git a/.changeset/red-houses-explode.md b/.changeset/red-houses-explode.md new file mode 100644 index 000000000..d355327f3 --- /dev/null +++ b/.changeset/red-houses-explode.md @@ -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) diff --git a/packages/astro/src/core/build/plugins/plugin-prerender.ts b/packages/astro/src/core/build/plugins/plugin-prerender.ts index d3d5305e4..0584f15a6 100644 --- a/packages/astro/src/core/build/plugins/plugin-prerender.ts +++ b/packages/astro/src/core/build/plugins/plugin-prerender.ts @@ -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 |