serve static assets from the build manifest
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 20.8k
- Forks
- 2.3k
- Avg merge
- 1d 16h
- Merged PRs (30d)
- 156
Description
Describe the problem
The static file server re-derives at request time what the build already computed, and each gap surfaces as its own bug:
- MIME types:
sirvbundles its ownmrmime, so kit'sutils/mime.jsadditions never reachadapter-node(#13753; patched at the response layer by #16564) Vary: Accept-Encodingsent for assets that were never precompressed (#15182, #16566)- filenames ending in
+404 in production but resolve in dev (#11766, still reproduces on 3.0.2) - startup
totalistwalk rebuilds a lookup the build already has; ETag is mtime-derived, not content-derived
Describe the proposed solution
Record the two things adapt time knows and currently discards (which files builder.compress produced variants for, and a content hash), then serve from the manifest: lookup and stream. Type from manifest.mimeTypes, Vary only where a variant exists, exact keys instead of path-guessing, no startup walk. sirv, totalist, @polka/url and mrmime drop out of adapter-node as a consequence. Exporting the server from @sveltejs/kit/node keeps adapter-node on one copy.
Alternatives considered
Upstreaming: sirv#173 open unreviewed since January, last release September 2025. Vendoring sirv's 249 lines as-is: fixes MIME but keeps the runtime re-derivation.
Importance
nice to have
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading the adapter-node static serving path and the manifest data produced by builder.compress. Trace which compression variants and content hash are currently discarded, then review the proposed server export from @sveltejs/kit/node. Done means serving uses manifest lookups and streams, with correct MIME types, conditional Vary headers, exact filenames, and no startup walk.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- backend, web-dev
- Issue type
- Refactor
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100