mirror of
https://github.com/withastro/astro.git
synced 2025-01-27 22:19:04 -05:00
Skip prerender chunk in static output (#10695)
This commit is contained in:
parent
ecb44351e9
commit
a15975e41c
2 changed files with 10 additions and 1 deletions
5
.changeset/plenty-bugs-hunt.md
Normal file
5
.changeset/plenty-bugs-hunt.md
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
---
|
||||||
|
"astro": patch
|
||||||
|
---
|
||||||
|
|
||||||
|
Skips prerender chunk if building with static output
|
|
@ -68,7 +68,6 @@ function vitePluginPrerender(opts: StaticBuildOptions, internals: BuildInternals
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
opts.allPages;
|
|
||||||
pageInfo.hasSharedModules = hasSharedModules;
|
pageInfo.hasSharedModules = hasSharedModules;
|
||||||
pageInfo.route.prerender = true;
|
pageInfo.route.prerender = true;
|
||||||
return 'prerender';
|
return 'prerender';
|
||||||
|
@ -87,6 +86,11 @@ export function pluginPrerender(
|
||||||
opts: StaticBuildOptions,
|
opts: StaticBuildOptions,
|
||||||
internals: BuildInternals
|
internals: BuildInternals
|
||||||
): AstroBuildPlugin {
|
): AstroBuildPlugin {
|
||||||
|
// Static output can skip prerender completely because we're already rendering all pages
|
||||||
|
if (opts.settings.config.output === 'static') {
|
||||||
|
return { targets: ['server'] };
|
||||||
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
targets: ['server'],
|
targets: ['server'],
|
||||||
hooks: {
|
hooks: {
|
||||||
|
|
Loading…
Add table
Reference in a new issue