Skip to content

Commit a15975e

Browse files
authored
Skip prerender chunk in static output (#10695)
1 parent ecb4435 commit a15975e

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

.changeset/plenty-bugs-hunt.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"astro": patch
3+
---
4+
5+
Skips prerender chunk if building with static output

packages/astro/src/core/build/plugins/plugin-prerender.ts

+5-1
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,6 @@ function vitePluginPrerender(opts: StaticBuildOptions, internals: BuildInternals
6868
}
6969
}
7070

71-
opts.allPages;
7271
pageInfo.hasSharedModules = hasSharedModules;
7372
pageInfo.route.prerender = true;
7473
return 'prerender';
@@ -87,6 +86,11 @@ export function pluginPrerender(
8786
opts: StaticBuildOptions,
8887
internals: BuildInternals
8988
): AstroBuildPlugin {
89+
// Static output can skip prerender completely because we're already rendering all pages
90+
if (opts.settings.config.output === 'static') {
91+
return { targets: ['server'] };
92+
}
93+
9094
return {
9195
targets: ['server'],
9296
hooks: {

0 commit comments

Comments
 (0)