-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Description
Describe the problem
Currently, prerendering happens inside adapters. This creates various minor problems:
svelte-kit previewdoesn't use prerendered pages — loss of fidelity, and slow performance that's unreflective of production build- adapters have to be careful to prerender before generating manifests
- prerendering doesn't happen if you haven't configured an adapter, or you're doing
svelte-kit buildlocally withadapter-auto(unless you prefix it likeVERCEL=1 npm run build)
Describe the proposed solution
I think prerendering should happen during build, before the adapter runs.
The fly in the ointment is adapter-static, which needs to specify that all pages should be prerendered (not just those explicitly marked as capable of being prerendered) unless a fallback is specified. A config.kit.prerender.all or config.kit.prerender.default option could stand in for that, and could also mean 'prerender everything without export const prerender = false. Together with a builder.prerenderFallback method, we could solve the adapter-static problem in a way that gives everyone a bit more flexibility. (Would probably need to make adapter-static aware of the all/default option via the builder so that it can instruct people to update their config accordingly.)
Alternatives considered
No response
Importance
nice to have
Additional Information
No response