Deployment
Building a game
Section titled “Building a game”# game repobun build src/main.ts --outdir dist --target browserOr rolldown / vite / webpack — the choice is yours; forge is plain ESM.
For a static site, drop index.html next to dist/main.js:
<!doctype html><html> <body> <div id="root"></div> <script type="module" src="./dist/main.js"></script> </body></html>GitHub Pages
Section titled “GitHub Pages”The coin-collector repo’s workflow is the canonical example: build on push to main, deploy dist/ + index.html to gh-pages.
on: { push: { branches: [main] } }jobs: build: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - uses: oven-sh/setup-bun@v2 - run: bun install - run: bun run build - uses: actions/upload-pages-artifact@v3 with: { path: dist } deploy: needs: build permissions: { pages: write, id-token: write } runs-on: ubuntu-latest steps: - uses: actions/deploy-pages@v4Astro embed
Section titled “Astro embed”Pattern via forbit-astro is TBD — link out to a future doc when it’s written. Short version: dynamically import the game module on the client, mount onto a div, listen for visibility events to start/stop.
Tauri (post-v1)
Section titled “Tauri (post-v1)”For itch.io or Steam wrappers, Tauri 2 hosts a webview around the same dist/ bundle. No engine changes needed — the engine is browser-pure.