0
Fork 0
mirror of https://github.com/withastro/astro.git synced 2025-02-17 22:44:24 -05:00

fix(assets): bundling regression for specific config on non-Node runtimes (#9087)

This commit is contained in:
Alexander Niebuhr 2023-11-14 07:53:14 +01:00 committed by GitHub
parent 554017b66a
commit b895113a0a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 1 deletions

View file

@ -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)

View file

@ -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