Publique seu app Svelte
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.
- 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.
- 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".
- 03
Publique
Execute "npx harvis deploy dist" a partir da raiz do seu projeto. Sem configuração e sem login para esta primeira publicação — você recebe um URL ao vivo imediatamente, mais um link privado de reivindicação para vincular o site a uma conta gratuita quando quiser.
Publique Svelte com um comando
Compile seu projeto e entregue a pasta de saída ao harvis. Nenhuma conta necessária para a primeira publicação — você recebe um link ao vivo e um link privado de reivindicação para gerenciá-lo depois.
npm run build npx harvis deploy dist
Prefere arrastar arquivos em vez de usar o terminal? Compile o projeto e solte a pasta de saída aqui para publicá-la da mesma forma.
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.
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.
Perguntas sobre publicar Svelte
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.
Publicar um app Svelte no harvis é realmente gratuito?
Sim, sem precisar de cartão. Os limites gratuitos são 500 arquivos e 50 MB por site, o que cobre um build estático de Svelte com folga. Sites publicados não expiram — eles ficam no ar até você excluí-los.
Posso usar meu próprio domínio com o site Svelte publicado?
Todo site recebe um endereço harvis.page gratuito, e você pode escolher seu próprio subdomínio pelo painel depois de reivindicá-lo — meu-app.harvis.page em vez de um aleatório. Apontar um domínio que você já possui (como minhaloja.com) para o site ainda não é suportado.
Qual a diferença entre isso e publicar Svelte no Vercel ou Netlify?
Vercel e Netlify giram em torno de conectar um repositório Git e rodar seu build nos servidores deles, com um painel para configurar tudo. O harvis pula tudo isso: você compila localmente (ou no seu próprio CI), executa um único comando da CLI apontando para a pasta de saída e recebe um link — sem configurar projeto nenhum, e sem precisar de conta até você querer manter o site.
Vai publicar outra coisa?
A receita é a mesma em todos os casos — compile e depois npx harvis deploy na saída.