SvelteKit
Deploy a SvelteKit site to LeafCloud.
Requirements
Section titled “Requirements”Validated with Node v24.22.1, SvelteKit 3.1.0, Svelte 5.57.2, Vite 8.3.5, adapter-static 4.0.0, and npm. Configure adapter-static through the SvelteKit Vite plugin and prerender the root layout.
-
Create a SvelteKit project and install its dependencies:
Terminal window npx sv create app --template minimal --types ts --no-add-ons --no-install < /dev/nullcd appnpm install < /dev/nullnpm install -D @sveltejs/adapter-static < /dev/null -
In
vite.config.ts, import adapter-static and pass it to the SvelteKit plugin. Add prerendering insrc/routes/+layout.js:import adapter from '@sveltejs/adapter-auto';import adapter from '@sveltejs/adapter-static';// Keep sveltekit({ adapter: adapter() }) in the Vite plugin options.src/routes/+layout.js export const prerender = true; -
Preview the deployment:
Terminal window leaf deploy --dry-runExpected output:
Framework: SvelteKit (adapter-static)Package manager: npmBuild command: npm run buildOutput directory: buildFiles: 14Total size: 88956 bytesDry run: nothing was uploaded.A real deploy replaces the final dry-run line with the live URL.
What LeafCloud detects
Section titled “What LeafCloud detects”SvelteKit (adapter-static); npm run build; build.
Common problems
Section titled “Common problems”Output directory does not exist: <project>/dist— adapter-auto was used without adapter-static. Install@sveltejs/adapter-staticand configure it invite.config.ts.svelte.config.jsis no longer used. Please pass configuration via thesveltekit(...)plugin in your Vite config. — removesvelte.config.jsand pass the adapter as an option tosveltekit(...)invite.config.ts.
For agents
Section titled “For agents”Run leaf deploy --dry-run --json first.
Check the exit code and stop if the JSON contains "error".
After a successful dry run, run leaf deploy --json --yes.
Never print credentials.
Validated on 2026-10-23 with SvelteKit 3.1.0.