Stacks
Static sites, React and Vue
Deploy plain HTML, or a React, Vue or Vite app built into static files.
What we detect
- Plain HTML: an
index.htmlat the root (or another home page we find). - React or Vue:
reactorvueinpackage.json, with no server framework. We run yourbuildscript and serve the output folder (distorbuild).
Static sites are served by nginx on port 80. There's no port to set and nothing to start.
Single-page apps
For React Router, Vue Router and other client-side routers, every path serves index.html, so reloading /dashboard works instead of showing a 404.
Build settings
We serve the folder your build writes to: dist or build, as Vite and Create React App do by default. Change the build itself with Build command in the project's Settings.
{
"scripts": {
"build": "vite build"
}
}Environment variables in a static site
A static site has no server: variables like VITE_API_URL are baked into the files at build time. Set them before deploying, and redeploy after changing them. Never put secrets in them: anyone can read them in the browser.
