Skip to main content

Deploy React on WebStadia

Deploy React apps built with Vite (or Create React App) on WebStadia.

Build settings

Vite

SettingValue
Build Commandnpm run build
Publish Directorydist

Create React App

SettingValue
Build Commandnpm run build
Publish Directorybuild

SPA routing

React apps use client-side routing. To make direct URL access work (e.g., /about), your site needs to serve index.html for all routes.

WebStadia handles this automatically for single-page applications.

Environment variables

For Vite, prefix environment variables with VITE_:

VITE_API_URL=https://api.example.com

Access in code:

const apiUrl = import.meta.env.VITE_API_URL