Static hosting¶
The browser output is a static ESM bundle. Serve the output together with its
HTML, CSS, and other assets from an HTTP(S) static host; do not open it from a
file: URL for production use. A local example is:
npm run build:browser -- --entry path/to/your-game.js --out path/to/bundle.js
cd path/to
python3 -m http.server 8080
For a deployed client, serve over HTTPS and proxy the WebSocket endpoint with
the matching wss: URL. For example, nginx can serve the static assets and
proxy /ws to a Node relay. Configure compression and
cache headers for generated assets according to the host; sourcemaps may be
kept private if their source disclosure is undesirable.
Static hosting does not supply WebSocket proxying, TURN, authentication, or CRDT persistence. Those are separate deployment concerns.