Documentation menu

Deploy a React app on Light Cloud - detected from the Vite or CRA setup, built to static files, and served from the global CDN for free bandwidth.

Deploy React

A React single-page app is detected from its dependencies and build config (vite.config.ts for Vite, react-scripts for Create React App) and deploys as a static site: npm run build fills the output directory, and the CDN serves it with free bandwidth. No server, no region, no cold starts.

Build#

SetupOutput directory
Vitedist
Create React Appbuild

Detection knows both; override in Build settings if your config moves it. The install step follows your lockfile - see How detection works.

Environment variables#

Static builds run with the environment's variables set, so build-time inlining works as usual: VITE_* (Vite) or REACT_APP_* (CRA). Each environment builds with its own values - a preview can point at a staging API while production uses the real one.

Warning

Inlined values ship to every browser. API base URLs and public keys are fine; secrets are not - those belong on the server side of whatever API the app calls.

Need a server?#

The React app itself needs none. When the backend is yours too, deploy it as its own app - Express, FastAPI, Go, and friends - and keep both in one repository with two root directories. Server-rendered React is Next.js or Remix.