Skip to reading
Build Tools & Game Export

Build and host the web version

Edition 0.86.3.4

Package desktop games, export editable Godot projects, and configure local or remote Android, iOS and browser builds with the required tools.

Download PDFView PDF page

WEB / HTML5

A browser game consists of several files that must be served together. Opening a lone index.html from a file manager is a poor test of a web export.

01  Choose Web (HTML5 / WebGL). Set the path to the compatible local Godot
    editor, or select a configured Web worker. Install matching Web export templates
    on whichever computer does the compiling.
02  Build into a writable folder. For a successful local build, open build/web inside
    the generated project. For a remote build, extract the returned ZIP. Keep
    index.html, JavaScript, WebAssembly, game data and generated support files
    together.
03  To test locally on a desktop with Python, open a terminal in build/web and run
    python3 -m http.server 8000 --bind 127.0.0.1. Open
    http://127.0.0.1:8000/ on that computer. This simple server is suitable for an
    ordinary local smoke test. Lua builds may need the isolation headers below.
04  For public hosting, serve the entire directory over HTTPS. The host should serve
    .wasm as application/wasm and JavaScript with a JavaScript MIME type. Test the
    hosted address, including the exact embedding page if applicable.

PCA3D uses the Compatibility renderer and WebGL 2 for this target. For a game with Lua records, the export uses extension support and needs a secure, cross-origin-isolated context. Configure Cross-Origin-Opener-Policy: same-origin and Cross-Origin-Embedder-Policy: require-corp. Check the browser console for missing files or isolation errors.

Page 14 of 19Permalink
Go to page