npm run build is a static dist/ folder that can be deployed to any static host.
Build for production
dist/:
Preview the production build locally
Before deploying, verify the build looks correct:http://localhost:4173 serving the dist/ folder.
Deploy to Vercel
Vercel is the easiest option — zero configuration needed for Vite projects.Import the repository on Vercel
Go to vercel.com/new, click Add New Project, and import your repository.
Confirm the framework preset
Vercel auto-detects Vite. Confirm the settings:
No environment variables are required.
| Setting | Value |
|---|---|
| Framework Preset | Vite |
| Build Command | vite build |
| Output Directory | dist |
| Install Command | npm install |
Deploy to Netlify
Connect your repository
Log in to netlify.com, click Add new site → Import an existing project, and connect your Git provider.
Set build settings
| Setting | Value |
|---|---|
| Branch to deploy | main (or your default branch) |
| Build command | npm run build |
| Publish directory | dist |
Deploy to GitHub Pages
There are two workarounds:- HashRouter (simplest)
- 404.html redirect workaround
Replace No other changes are needed — the rest of the routing code stays the same.
BrowserRouter with HashRouter in src/App.jsx. Routes will use hash-based URLs (/#/projects instead of /projects).src/App.jsx
Configure the base path in vite.config.js
If your GitHub Pages site is hosted at a sub-path (e.g., If the site is at the root (user/org pages with a
https://username.github.io/repo-name/), set the base option:vite.config.js
username.github.io repo), leave base as '/' or omit it.Important: iframe CORS and embedding
The 3D monitor renders your portfolio inside an<iframe>. The embedded site must permit being framed.
To check whether a URL allows embedding:
SAMEORIGIN / frame-ancestors *, the iframe will work. Vercel-hosted React apps typically do not set X-Frame-Options by default.