feat: skip server builds for static/SPA type apps - #16823
Conversation
|
Install the latest version of pnpm add https://pkg.svelte.dev/@sveltejs/kit/c/248d7bce4781767aaf7c997b1ad02cf58e0262cbOpen in |
🦋 Changeset detectedLatest commit: 248d7bc The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Co-authored-by: vercel[bot] <35613825+vercel[bot]@users.noreply.github.com>
|
|
||
| let should_prerender = false; | ||
| const { manifest, server, log_response, vite_dev_server } = await (manifest_path | ||
| ? get_ssr_build_server({ |
There was a problem hiding this comment.
Pulled this branch into mine to test cloudflare implications, this is the only thing that caused issues (it seemed to work when I swapped out this conditional to always return get_ssr_vite_server)
There was a problem hiding this comment.
Will probably need to change this later on so that it runs a Vite server with the SSR build output; similar to what I did in a previous PR. This ensures that the adapter Vite plugin stubs are run throughout prerendering
closes #13217
testing
This PR spins up a Vite dev server to perform analysis and prerendering instead of coupling those processes with the SSR build so that we can skip the SSR build if it's not needed.
Why we can do this: during analysis, we're just reading file exports, it doesn't matter if they're built or not. Meanwhile, if everything is prerendered or if SSR is disabled, we have no use for the SSR build output; we build the client and feed its build output filepaths to the SSR manifest during prerendering. Doing so links to the correct client build output chunks when we save the dev server responses.
TODOS
vite previewwork without an SSR buildPlease don't delete this checklist! Before submitting the PR, please make sure you do the following:
Tests
pnpm testand lint the project withpnpm lintandpnpm checkChangesets
pnpm changesetand following the prompts. Changesets that add features should beminorand those that fix bugs should bepatch. Please prefix changeset messages withfeat:,fix:, orchore:.Edits