Run ‘vite build’ to produce a dist folder, set the correct ‘base’ path in vite.config for your hosting, then deploy: point Vercel at the repo (or run ‘vercel’), or push dist to a gh-pages branch for GitHub Pages. Both serve static files, so no server code is needed.
At a glance
| Fact | Value | Source |
|---|---|---|
| Vite build command | vite build | vite.dev |
| Output folder Vite produces | dist | vite.dev |
| GitHub Pages serves | static files only |
Both Vercel and GitHub Pages serve static files, and a Vite production build is exactly that: run vite build, which outputs a dist folder with an index.html and hashed JS/CSS assets. The only real gotcha is the base path in vite.config.js – it must match where the site actually lives, or assets fail to load.
Playgama Bridge adapts one HTML5 build to 25+ platforms, and Playgama Wrap publishes on your own domain.
How do you configure and deploy to each host?
- Vercel: import the repo in the Vercel dashboard (it auto-detects Vite: build command
vite build, output directorydist), or runvercelfrom the project root. Leavebaseas the default/unless you’re serving from a subpath. - GitHub Pages: set
base: '/your-repo-name/'invite.config.jsif deploying to a project page (username.github.io/repo). Build, then push thedistcontents to agh-pagesbranch (a tool likegh-pagesnpm package or a GitHub Action automates this), or enable Pages to serve from adocsfolder.
Once you have a working build, the same dist output can go to other places too: Poki, CrazyGames, GameDistribution, itch.io (which serves HTML5 games in an iframe on its own domain), and playgama.com.
Check before you ship: relative asset paths, that routing (if any) doesn’t rely on server rewrites GitHub Pages can’t do, and that large WASM/asset files aren’t blocked by hosting file-size limits.
Sources
- Playgama for developers
- Poki for developers
- CrazyGames for developers
- GameDistribution
- itch.io creators FAQ
Related questions
Does GitHub Pages support server-side routing for a Vite SPA?
No, GitHub Pages only serves static files, so there is no server rewrite rule for client-side routes.
Why do my game assets fail to load after deploying to GitHub Pages?
The Vite ‘base’ path in vite.config.js probably doesn’t match the repo subpath. Set it to ‘/your-repo-name/’ and rebuild before pushing.
Last updated: 24 September 2026