Sample.app
Framework Guides

React

Deploy a React (Vite) project to Sample.app.

React apps scaffolded with Vite (via create-vite or npm create vite) output to dist/ by default, which the CLI auto-detects.

Deploy

Build your project

bash npm run build
bash bun run build
bash pnpm build

Deploy to Sample.app

Since Vite uses dist/ by default, auto-detection works:

samplex deploy

Or specify the directory explicitly:

samplex deploy ./dist

Client-side routing

If you're using React Router or TanStack Router, Sample.app's SPA fallback serves /index.html for all unmatched routes automatically.

No additional configuration needed — client-side routing works out of the box.

Custom output directory

If you've changed the output directory in your Vite config:

vite.config.ts
export default defineConfig({
  build: {
    outDir: "my-output",
  },
});

Pass it to the deploy command:

samplex deploy ./my-output

Auto-detection only looks for dist, build, and out. If you use a custom directory name, you must specify it explicitly.

On this page