-
-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Prerender during build rather than adapt #4112
Comments
Another thing that has been an issue is that the service workers are currently generated before prerendering and so they can't include prerendered content. We might be able to fix that as well if prerendering happened during build |
Ah yeah, excellent point. That's a decisive advantage |
(I'm going to tag on a couple more issues here as comments that I might might be related.) Sometimes I get an error during
What I think is happening is that the "build" stage inlines it to a "data:..." image but the "adapt" stage doesn't know that (???), and |
Related: #3792, which would be fixed by |
Describe the problem
Currently, prerendering happens inside adapters. This creates various minor problems:
svelte-kit preview
doesn't use prerendered pages — loss of fidelity, and slow performance that's unreflective of production buildsvelte-kit build
locally 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. Aconfig.kit.prerender.all
orconfig.kit.prerender.default
option could stand in for that, and could also mean 'prerender everything withoutexport const prerender = false
. Together with abuilder.prerenderFallback
method, we could solve theadapter-static
problem in a way that gives everyone a bit more flexibility. (Would probably need to makeadapter-static
aware of theall
/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
The text was updated successfully, but these errors were encountered: