SvelteKit 3 Moves Config Into Vite and Renames $lib to #lib
Software / news
SvelteKit 3 Moves Config Into Vite and Renames $lib to #lib
The stable release on Oct. 1 requires Svelte 5 and Vite 8, and the new import alias needs a file extension on every path.
SvelteKit 3 shipped Oct. 1, and every project that upgrades has to touch two things it has not touched before: the config file and every import that starts with $lib. The Svelte team's release post calls it "the same framework with a little more polish, a little more type safety, and a little less junk."
The junk being removed is the part that breaks builds. SvelteKit 3 requires Svelte 5 and Vite 8, according to the team's release candidate post of Aug. 13, so a project still on Svelte 4 cannot take the upgrade in one step.
The changes that break a build
The release candidate post lists six breaking changes. Each one is a find-and-replace across a real codebase, and the first two reach almost every file.
| Before | In SvelteKit 3 |
|---|---|
Config in svelte.config.js | Config in vite.config.ts |
$lib/foo | #lib/foo.ts, extension required |
tsconfig.json extends ./.svelte-kit/tsconfig.json | Extends $app/tsconfig |
$service-worker module | $app/env, $app/paths and new $app/manifest |
| Vite optional | Vite 8 required |
pushState and replaceState | goto with shallow: true |
The #lib change leans on Node's own subpath imports declared in package.json, instead of a SvelteKit-specific alias. The cost is the file extension. An import that read $lib/utils becomes #lib/utils.ts.
The config move has a documented reason. Configuration now sits in vite.config.ts so the Vite plugin can read it synchronously instead of waiting on an asynchronous resolution step, according to InfoQ's report on the release candidate.
The migration command and what it covers
The team ships a codemod, run with npx sv migrate sveltekit-3 --tasks all --confirm. New projects start from npx sv create my-new-app. The post does not say which of the six changes the codemod cannot do, and no one has published a count of how many manual edits remain after it runs. This report did not run the migration against a real project.
The release candidate went out Aug. 13, so the gap to the stable release was 49 days.
What is still experimental
Remote functions, the type-safe client-server calls the team has made its top priority, are not part of the stable surface. They still sit behind an experimental flag that depends on Async Svelte.
The team's release candidate post describes the error-handling rework as the other headline feature: +error.svelte rendering on failures, with sourcemap support, and environment variables validated against a schema. Neither is a reason to rush the upgrade, since the build-breaking changes arrive whether or not an app uses them.
Breaking releases tend to hit the tools around a framework first. Zig 0.17.0 broke its language server until that tool's own release landed. The Svelte post lists no tool that breaks on SvelteKit 3. For a different take on what a web page should cost, see IANA's example.com redesign, which it justified on bandwidth.
The next date to plan around is Svelte Summit 2026 in Ljubljana, Slovenia, on Nov. 19 and 20, which the team said will also mark Svelte's 10th birthday.
Sources
More in Software
- 01Fyra Labs Says Tov's Faster-Than-Rust Benchmarks Compare Against Slowed RustTov's own README table now shows Rust ahead on four of 12 tests, and a rival's rewrite of the Rust code erased the dispatch and hash-map leads.
- 02Roc's Pure-Functional DEFLATE Lands 2.6 to 8.9 Percent Behind C's libdeflateRichard Feldman's own 144-benchmark run on two machines found a worst case of about 18 percent slower and a best case of just over 18 percent faster, before Roc has a numbered release.
- 03Google's Privacy Policy Now Lets Opted-In Gmail Data Reach Ad ServicesThe Oct. 16 revision keeps the promise of no ads from Gmail content but adds an exception for anyone who connects the inbox to Search through Personal Intelligence.
- 04UUIDv7 Guarantees Uniqueness and Little Else, and Python 3.14's Generator Kept Running Ahead of a Reset ClockRobert Alexander's Oct. 19 post sets RFC 9562's own wording against the ordering, timestamp and unguessability assumptions developers make.