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 buildmust succeed. - Forge:
reliant forgeinside Reliant, ornpx -y @reliantlabs/forge@latestanywhere 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’spublic_dir names, dist for Vite. Two settings in vite.config.ts decide whether the result works:
build.outDirmust staydist(or matchpublic_dirin each env’smain.k).basemust match where the site is mounted. At the root of its hostname that is Vite’s default,/. Abase: "/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: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: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
terminal
terminal
--claimable is refused: use the first form. See Deploy without an account.4
Verify
terminal
/assets/…, which mean a wrong base.Per-environment settings without a rebuild
AVITE_* 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:
basedoesn’t match the mount. outDirchanged: setpublic_dirin every env’smain.kto match, orlint --static-exportfails.- Over 1 GiB: a release is kept three times, so about 340 MiB of build output fits. Move videos to object storage.