Sveltekit: Ensure SSR is disabled #20804
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Issue: #
Sveltekit recently made a change which stopped setting
build.ssr
tofalse
, and it is instead nowtrue
because of https://github.com/sveltejs/kit/blob/ead8fa8f8b7dd7fb73bdd1a6a2c3c2172162a25d/packages/kit/src/exports/vite/index.js#L254. This causes Vite to throw an error:What I did
We can't set
build.ssr
tofalse
in builder-vite, because then sveltekit will overwrite it. So we need to use a plugin that's loaded after the sveltekit plugin, which resetsbuild.ssr
to false, which is what I've done here.The other option would be for sveltekit to move this config into their
vite-plugin-sveltekit-compile
plugin, but there may be internal pushback against that from the sveltekit team.How to test
If the sveltekit sandbox builds, we're good to go.
Checklist
MIGRATION.MD
Maintainers
make sure to add the
ci:merged
orci:daily
GH label to it.["cleanup", "BREAKING CHANGE", "feature request", "bug", "documentation", "maintenance", "dependencies", "other"]