kit
kit copied to clipboard
Disable generation of server code
Describe the problem
SvelteKit seems to always generate files to the .svelte-kit/output/server/ directory – even with export const ssr = false in src/routes/+layout.ts, and even with the static adapter and prerender set to false.
That doesn't seem to make sense if only client code will be shipped.
Describe the proposed solution
It would be great to have a configuration option that disables all generation of server side JavaScript code. This would save build time, disk space, and therefore energy consumption in all local, server-side and CI-based cases where SvelteKit builds are executed.
Alternatives considered
No response
Importance
nice to have
Additional Information
No response
I'm using SvelteKit, but with a Flask backend. I have no use for the server part of SvelteKit; I only want to use the routing. The additional build takes extra time and is noisy (since I don't use it). Please enable us to disable it. IMO the routing and server functionality shouldn't be coupled. It makes SvelteKit less desirable if it's all-or-nothing.
This might be more feasible once we've moved to the Vite Environment API
- https://main.vitejs.dev/guide/api-environment