This runs tsc -b to type-check your project, then bundles everything with Vite. Output goes to the dist/ directory.
2
Preview the production build locally
npm run preview
Vite serves the dist/ folder at http://localhost:4173 so you can verify everything works before deploying.
Because the app uses React Router with the HTML5 History API, your host must serve index.html for every route — not just /. Without this, refreshing a page like /features returns a 404. Each platform section below explains exactly how to configure this.
In your repository settings, go to Pages and set the source to the gh-pages branch.
1
Connect your repo
In the Cloudflare dashboard, go to Workers & Pages → Create → Pages and connect your GitHub repository.
2
Configure build settings
Set the following:
Build command: npm run build
Build output directory: dist
3
Add an SPA redirect rule
Create the file public/_redirects with this content:
public/_redirects
/* /index.html 200
Cloudflare Pages respects the same _redirects format as Netlify.
4
Deploy
Click Save and Deploy. Cloudflare Pages rebuilds on every push.
Any host that can serve static files can deploy this app.
1
Build the app
npm run build
2
Upload the dist/ folder
Upload the entire contents of dist/ to your hosting provider.
3
Configure 404 fallback for SPA routing
Configure your host to serve index.html in response to any 404 request. The exact setting varies by platform — look for options like “custom 404 page”, “error document”, or “fallback document”.
Static assets in the public/ directory (like vite.svg) are copied to dist/ during the build and served at the root path.