Update SvelteKit to 3
· Updated on
The project currently runs on @sveltejs/kit ^2.69.3. SvelteKit
3 is in its release candidate phase (3.0.0-next.23 on the next tag), with a stable release promised without further breaking changes. The
rest of the toolchain already meets the v3 minimums: Node 24, TypeScript 6,
Svelte 5.56.6, Vite 8.1.5, vite-plugin-svelte 7.2.0.
Tasks
- Bump
@sveltejs/kitto 3.x and@sveltejs/adapter-staticto 4.x (other dependencies already satisfy v3 requirements) - Move all
kit.*config andcompilerOptionsfromsvelte.config.jsinto thesveltekit()plugin options invite.config.js, then deletesvelte.config.js - Replace the
$libalias with#libsubpath imports (126 files, explicit file extensions required); keep the$stylesalias via plugin options - Switch
Header.sveltefrom$app/storesto$app/state(the last remaining usage) - Drop the removed
baseimport from$app/pathsin the sitemap page and both feed endpoints (it is an empty string here) - Move
experimental.remoteFunctionsinto plugin options; remote functions inpages.remote.jsneed no code changes (noevent.url/paramsaccess) - Add
"prepare": "svelte-kit sync"topackage.json(v3 removes the preinstall hook) and pointjsconfig.jsonat$app/tsconfig - Verify
pnpm lint,pnpm check,pnpm test:ci, andpnpm buildpass; smoke-test the preview build
Not affected
Service workers, cookies, and CSRF changes do not apply to this static site.
The pushState shallow-routing migration is moot: the only usage
was dead code and has been removed. $env modules are not used.
The Vite 8 / rolldown compatibility risk for vite-imagetools, the LQIP inliner plugin, and Lightning CSS was
already cleared by the earlier Vite upgrade.
Read next
