Svelte (Vite)
Deploy a Svelte site made with Vite to LeafCloud.
Requirements
Section titled “Requirements”Validated with Node v24.22.1, Svelte 5.57.2, Vite 8.3.5, @sveltejs/vite-plugin-svelte 7.3.1, and npm. No configuration change is required.
-
Create the official Svelte starter:
Terminal window npm create vite@latest app -- --template svelte < /dev/nullcd appnpm install < /dev/null -
No config change is needed.
-
Preview the deployment:
Terminal window leaf deploy --dry-runExpected output:
Framework: SveltePackage manager: npmBuild command: npm run buildOutput directory: distFiles: 7Total size: 71735 bytesDry run: nothing was uploaded.A real deploy prints
✓ Live at <url> (<files> files, <uploaded> uploaded)instead of the final dry-run line.
What LeafCloud detects
Section titled “What LeafCloud detects”Svelte; npm run build; dist.
Common problems
Section titled “Common problems”No Svelte + Vite-specific refusal was captured in validation.
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 Svelte 5.57.2 and Vite 8.3.5.