Configuration option for prerendering pages (overrides output mode) #618
Closed
humanfriend22
started this conversation in
Proposal
Replies: 1 comment
-
I think this is possible already: you have the global |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Body
Summary
A configuration option to specify which files to prerender when using the
hybrid
orserver
output mode. We could allowbuild.prerenderPages
to take a:boolean -> to globally prerender all pages while maintaining server API routes, etc
array -> an array of paths to hard code files to prerender
function -> custom logic to decide whether to prerender or not
This is probably the opposite of the hybrid mode.
Background & Motivation
I needed all my pages to be pre-rendered but had some backend apis I wanted to be maintained.
Goals
build.prerenderPages
)Example
This would be opt-in and would not break any existing code as developers can either add
build.prerenderPages
to their project orexport const prerender = boolean
.PR?
This is my first real project with Astro and don't have a great understanding of the API so this might already exist but I found out where
export const prerender = boolean
is being read and it doesn't seem it is being influenced by the config.Beta Was this translation helpful? Give feedback.
All reactions