Menu

Shipping a browser game as a static site (and why game portals want something else)
📰

Shipping a browser game as a static site (and why game portals want something else)

DEV Community: typescript·Nick.Hu·4 days ago
#FAckVxSj
#devtotypescript#devto#dev#build#game
Reading 0:00
15s threshold

I built a racing game where you draw the circuit yourself. It runs at https://apexdrawn.org/ with no download and no launcher. That decision shaped the whole repo, and it is also the reason I cannot just zip the build and upload it to a game portal.

What the repo actually is

A Vite + React + TypeScript static site. The build script is three steps:

"build" : "tsc -b && vite build && node scripts/generate-seo-pages.mjs"

Enter fullscreen mode

Exit fullscreen mode

That last step matters more than it looks. The site serves English plus Spanish, Italian, French and German pages, so the localization output is generated at build time rather than at runtime. Deploying is just shipping the dist directory to Cloudflare Pages.

Behind it there is a Worker for /api/* , a WebSocket relay at /r , Clerk for auth, and D1 migrations. The game itself lives as its own HTML document rather than as a React component tree.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.