Compiling for the Web

See also

This page describes how to compile HTML5 editor and export template binaries from source. If you're looking to export your project to HTML5 instead, read Exporting for the Web.


To compile export templates for the Web, the following is required:

See also

To get the Godot source code for compiling, see Getting the source.

For a general overview of SCons usage for Godot, see Introduction to the buildsystem.

Building export templates

Before starting, confirm that emcc is available in your PATH. This is usually configured by the Emscripten SDK, e.g. when invoking emsdk activate and source ./

Open a terminal and navigate to the root directory of the engine source code. Then instruct SCons to build the Web platform. Specify target as either template_release for a release build or template_debug for a debug build:

scons platform=web target=template_release
scons platform=web target=template_debug

By default, the JavaScript singleton will be built into the engine. Official export templates also have the JavaScript singleton enabled. Since eval() calls can be a security concern, the javascript_eval option can be used to build without the singleton:

scons platform=web target=template_release javascript_eval=no
scons platform=web target=template_debug javascript_eval=no

The engine will now be compiled to WebAssembly by Emscripten. Once finished, the resulting file will be placed in the bin subdirectory. Its name is for release or for debug.

Finally, rename the zip archive to for the release template:

mv bin/ bin/

And for the debug template:

mv bin/ bin/


The default export templates do not include GDExtension support for performance and compatibility reasons. See the export page for more info.

You can build the export templates using the option dlink_enabled=yes to enable GDExtension support:

scons platform=web dlink_enabled=yes target=template_release
scons platform=web dlink_enabled=yes target=template_debug

Once finished, the resulting file will be placed in the bin subdirectory. Its name will have _dlink added.

Finally, rename the zip archives to and for the release template:

mv bin/ bin/
mv bin/ bin/