Vite builds React, Vue, Svelte, Solid and plain JavaScript projects into a folder of static files, dist/. Lobsite hosts that folder. Run npm run build, then npx lobsite, and the app is live at a *.lobsite.app address with HTTPS. If the app has client-side routing, one setting makes deep links work.
How it works
- Build with
npm run build(that'svite build). The app lands indist/, with hashed files indist/assets/. - Run
npx lobsitein the project. It deploysdist/, notpublic/, which Vite has already copied into the build. The first deploy needs no account and lasts 6 hours. - Turn on single-page mode if the app has a router: add
spa = truetolobsite.toml, or flip Single-page app in the site's settings. Then keep the site with the claim link, in a free account.
Routing and single-page mode
A Vite app with React Router, Vue Router or TanStack Router has one index.html. Opening /settings directly asks the server for a file that doesn't exist. With single-page mode on, Lobsite answers those paths with your index.html, and the router draws the page:
# lobsite.toml
spa = true
Only page requests get the app. A missing file such as an old /assets/index-3f9a.js gets a real 404, so a visitor who still has the previous version open after a deploy gets a clear error, not HTML in place of a script. The deploy prints a tip when package.json has a router and single-page mode is off. More in the docs.
vite.config and the build
basestays at its default,/: the app is served from the top of its address. Set it only for a GitHub Pages project site, then remove it when you move.- Environment variables starting with
VITE_are written into the build. They're visible to anyone who opens the app, so keep secrets out of them;.envfiles themselves are never deployed. - Several pages (
build.rollupOptions.inputwith more than one HTML file) are a multi-page site: each page is a file, and single-page mode isn't needed. npm run previewservesdist/locally, which is the quickest check before a deploy.
Caching hashed files
Vite puts a hash of each file's contents in its name, as in index-3f9a.js, so a file with a given name never changes. Lobsite stores files by content too, so a deploy uploads only the chunks that changed. To let browsers keep those files for a year, add a header rule:
[[headers]]
for = "/assets/*"
[headers.values]
Cache-Control = "public, max-age=31536000, immutable"
index.html is always checked again, so visitors get the new version straight after a deploy.
spa = true in lobsite.toml, or one switch in the dashboard: deep links open your app, missing files still 404.
Files are stored by their hash. Redeploying an unchanged site uploads 0 bytes.
Preview before going live. Roll back in one click, redirects and all.
Every site gets a *.lobsite.app address with HTTPS from the first deploy.
Redirects, headers and forms live in lobsite.toml and travel with each deploy.
A deploy without an account is live for 6 hours. The claim link keeps it, free.
Vite hosts compared
| Lobsite | Netlify | Vercel | GitHub Pages | |
|---|---|---|---|---|
| Deep links in a single-page app | spa = true, or a switch in the dashboard |
A _redirects rule |
A rewrite in vercel.json |
No: copy index.html to 404.html, served with status 404 |
| Missing script files | 404 | The app's index.html |
The app's index.html |
404 |
| Builds on the server | No: you deploy dist/ |
Yes | Yes | In GitHub Actions |
| Account before the first deploy | No: live 6 hours, then keep it free | Yes | Yes | Yes, and a repository |
| Custom domain | Yes, free | Yes | Yes | Yes |
Netlify and Vercel build from Git and run server functions. Lobsite is the quickest way to put a built Vite app online from your machine, CI or an AI agent, with single-page routing that's one line or one click.
Frequently asked questions
Why do Vite app pages other than the home page show "Not found"?
The app uses client-side routing, and the server has no file for those paths. Turn on single-page mode: spa = true in lobsite.toml, or Single-page app in the site's settings.
Does Lobsite run my Vite build?
No. Build on your machine or in CI, then deploy dist/. What you checked with npm run preview is exactly what goes live.
Can I use Vite environment variables?
Yes, the VITE_ ones, which are written into the build when you run it. Build again after changing them. Anything secret belongs on a server, not in a Vite app.
Does a Vite multi-page site need single-page mode?
No. Each HTML page is its own file, and about.html opens at /about. Leave single-page mode off, so a mistyped address gets your 404.html.