sveltejs / sveltejs/kit

Disable generation of server code

Open
#12,555 2 comments 7 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

adapters - general vite
Dominant language
JavaScript
Stars
20.8k
Forks
2.3k
Avg merge
1d 16h
Merged PRs (30d)
156

Description

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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing how SvelteKit generates .svelte-kit/output/server/ when src/routes/+layout.ts uses export const ssr = false, including builds using the static adapter and prerender set to false. Define the configuration boundary for disabling server-side JavaScript generation and verify that client output still builds without the server directory.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
build-system
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.