Skip to main content
You will put an existing Vite app on Reliant hosting’s static hosting, behind a CDN, on a generated hostname. A Vite build is already a folder of static files, so Forge adds only its declarations and never touches package.json, src/ or vite.config.ts. This guide was run on a fresh npm create vite@latest -- --template react-ts app at Forge v1.10.1-0.20261123064811-54313eead62f.

Before you begin

  • Node.js, and the app in a git repository. npm run build must succeed.
  • Forge: reliant forge inside Reliant, or npx -y @reliantlabs/forge@latest anywhere else.
  • Nothing to pay: one hosted static site per person is free (1 GiB of storage, 10 GiB of traffic a month). Each environment’s site counts, so staging and prod both deployed is two.

What the build must produce

Forge publishes the directory the env’s public_dir names, dist for Vite. Two settings in vite.config.ts decide whether the result works:
  • build.outDir must stay dist (or match public_dir in each env’s main.k).
  • base must match where the site is mounted. At the root of its hostname that is Vite’s default, /. A base: "/app/" copied from a GitHub Pages setup makes every asset 404.
reliant forge lint --static-export checks both and prints what it found, for example web (vite-spa): base "/" (Vite's default — vite.config.ts sets no base) matches the mount in env prod, staging. Client-side routes work: an unknown path with no extension falls back to index.html with a 200, so React Router’s /settings loads. A missing file with an extension is a 404. Anything in the bundle is public, so a VITE_* variable is never a secret; an API key belongs on a backend.
1

Adopt the app

terminal
Output
--dry-run works only with --kind app; for a site, review the files after writing them. Commit them, kcl.mod.lock included.
2

Build and check

terminal
Output (trimmed)
reliant forge env up dev runs the Vite dev server and mirrors the browser console into .forge/logs/dev/.
3

Deploy

Signed in, build one release and deploy it:
terminal
To promote the same bytes later, deploy that release to another env; nothing rebuilds. A second hosted site (staging as well as prod) needs billing, and until then that deploy is queued with exit 7.With no account, one command adopts the app if it isn’t yet and publishes it:
terminal
It prints the URL and a claim link. The site stays up for 72 hours; opening the link and signing up (free) makes it permanent and yours. A static site isn’t affected by the no-outbound-internet rule, because its requests come from the browser. Inside Reliant you are signed in and --claimable is refused: use the first form. See Deploy without an account.
4

Verify

terminal
Both should return 200. Open the page in a browser and check the console for 404s on /assets/…, which mean a wrong base.

Per-environment settings without a rebuild

A VITE_* value is baked in at build time, so a release built for staging carries staging’s API URL into prod. For values that differ per env, put them in the frontend’s runtime_config in each main.k; the platform serves them as /config.js (window.__FORGE_CONFIG__). Load it with a plain blocking <script src="/config.js"></script> in index.html’s <head>, before your bundle. Deploy a static site covers it, and custom domains, in full.

Vite gotchas

  • Blank page, assets 404: base doesn’t match the mount.
  • outDir changed: set public_dir in every env’s main.k to match, or lint --static-export fails.
  • Over 1 GiB: a release is kept three times, so about 340 MiB of build output fits. Move videos to object storage.
See also: Adopt an existing Vite or Next.js app, Custom domains, Hosting limits.