Svelte

Deploy your Svelte app

Plain Svelte (scaffolded with npm create vite -- --template svelte) is a normal static Vite build. SvelteKit is different by default — it expects a server — so it needs one extra step to output static files instead.

steps
  1. 01

    Plain Svelte: just build

    Run "npm run build". Like any Vite template, it writes static HTML, CSS, and JS to "dist" — nothing else to configure.

  2. 02

    SvelteKit: switch to the static adapter

    Install "@sveltejs/adapter-static", set it as the adapter in svelte.config.js, and run "npm run build". Output goes to "build" by default (configurable in the adapter options) instead of "dist".

  3. 03

    Deploy it

    Run "npx harvis deploy dist" from your project root. No config and no login for this first deploy — you get a live URL immediately, plus a private claim link to attach the site to a free account whenever you're ready.

Deploy Svelte with one command

Build your project, then hand the output folder to harvis. No account needed for the first deploy — you'll get a live link and a private claim link to manage it later.

terminal
npm run build
npx harvis deploy dist

Prefer dragging files instead of a terminal? Build the project, then drop the output folder here and publish it the same way.

git hook

Deploy Svelte on every git push

The command above is one you will run again after every change. A git hook runs it for you: this one already points at dist, the folder Svelte builds into.

The folder holding the finished site. "." is the repo root, which is right for hand-written HTML; a static-site generator writes somewhere else.

pre-push fires on every branch and every remote, so a feature branch would publish over your live site. With this on, a push from anywhere else exits early and goes through untouched.

in your repo root
cat > .git/hooks/pre-push <<'EOF'
#!/bin/sh
set -e
npm run build
harvis deploy dist
EOF
chmod +x .git/hooks/pre-push

The options, the gotchas and how to share a hook with your team are on the git hook page.

Svelte deploy questions

How do I know if my project is plain Svelte or SvelteKit?

Check package.json: SvelteKit projects depend on "@sveltejs/kit" and have a "src/routes" folder. Plain Svelte (the Vite template) doesn't — it's a single App.svelte with no server-side concept at all.

SvelteKit's adapter-static warns about "prerender" — what does that mean?

adapter-static needs every route pre-rendered at build time since there's no server to render them on request. Add "export const prerender = true" to your root +layout.js (or per-route) to opt every page in.

Is deploying a Svelte app to harvis actually free?

Yes, no card required. Free limits are 500 files and 50 MB per site, which covers a static Svelte build with plenty of room. Published sites don't expire — they stay live until you delete them.

Can I use my own domain with the deployed Svelte site?

Every site gets a free harvis.page address, and you can pick your own subdomain from the dashboard after claiming it — my-app.harvis.page instead of a random one. Pointing a domain you already own (like mystore.com) at the site isn't supported yet.

How is this different from deploying Svelte to Vercel or Netlify?

Vercel and Netlify are built around connecting a Git repo and running your build on their servers, with a dashboard to configure it. harvis skips all of that: you build locally (or in your own CI), run one CLI command against the output folder, and get a link — no project setup, and no account needed until you want to keep the site.

other frameworks

Deploying something else?

The recipe is the same everywhere — build it, then npx harvis deploy the output.