deploy.ccSelf-hosting deploy handbook
deploy.cc / Guides / Vite(React / Vue SPA)

Vite(React / Vue SPA) deploy guide

Vite SPAs output dist/. The key is the fallback: unknown paths must serve index.html.

Build
npm run build
Output
dist/
Official docs
Vite Deploying a Static Site · Cloudflare Pages SPA rendering

How to deploy

  1. npm run build and upload dist/.
  2. Nginx: try_files $uri $uri/ /index.html;
  3. Netlify: /* /index.html 200 in public/_redirects.
  4. Cloudflare Pages: treated as an SPA when there is no 404.html.
  5. GitHub Pages: set Vite base for sub-paths; copy index.html to 404.html as a fallback (returns status 404).

Per platform

PlatformNotes
Cloudflare Pages / Netlify / VercelBuild npm run build, output dist.
VPS + Nginxtry_files fallback to index.html.

Notes

Generate a config