All templates

Deploy a Vite + React app on Rebasable

Single-page app built with Vite and React 19, with the index.html rewrite for client-side routing.

Runtime: static Static site, free staticreactspa

How it works

The build runs tsc -b && vite build and Rebasable serves dist/. The rewrite route sends every unknown path to /index.html, so React Router or TanStack Router deep links work after a refresh. Hashed files in /assets/ are cached for a year.

Run it locally

npm install
npm run dev   # http://localhost:5173

Use it as your own repository

Copy the vite-react folder of the templates repository into a new repo (the files at the root, rebasable.yaml included) and push it. Then add a Deploy button to its README, or create it from Blueprints, New blueprint in the dashboard. From then on, every push deploys, and pull requests get preview environments.

Good to know

  • Variables used in the browser must start with VITE_ and are read at build time.
  • Calling your own API? Deploy it as a second service in the same rebasable.yaml and pass its URL with fromService and property: host.