Skip to content

Web Configuration ​

Set properties in MyGame.web.csproj, which references 2dog.engine and 2dog.browser-wasm. The generated host uses RuntimeIdentifier=browser-wasm and defaults to Release; pass -c Debug for a Debug build. See global settings for the game directory and import controls.

Properties ​

PropertyDefaultPurpose
TwoDogWebVariantdebug in Debug, editor in Editor, release otherwiseNative Web engine; explicit settings override the default. The editor variant is unsupported
TwoDogExportPacktrueExport game content; false uses an existing wwwroot/godot.pck
TwoDogWebExportPresetWebPreset in export_presets.cfg
TwoDogWebPackNamegodot.pckDeployed pack name
TwoDogWebSizeManifesttrueWrite twodog.sizes.json for loading progress
TwoDogWebStripMapstrue with the release engineRemove JavaScript source maps
TwoDogWebPrecompresstrue with dotnet publishWrite Brotli (.br) and gzip (.gz) copies of large bundle files
TwoDogWebPrecompressLevelOptimalOptimal (balance speed and size), Fastest, SmallestSize (slower), or NoCompression; case-insensitive
TwoDogWebSideModuleExportstrueExport native symbols used by GDExtensions
WasmEmitSymbolMapfalse in Release, true otherwiseInclude native symbols for stack traces; explicit settings override the default
WasmInitialHeapSize256MBInitial memory allocation; memory can grow

2dog.browser-wasm restores both debug and release natives. A missing selected payload fails the build. Editor configuration selects the unsupported editor variant and fails; use Debug or Release, or explicitly select a supported variant.

Changing TwoDogWebPackName also requires matching the pack URL in your boot page.

Precompression ​

dotnet publish enables precompression; set TwoDogWebPrecompress=false to skip it. Originals are kept. Currently, Full and Mono MSBuild skip this step even when explicitly enabled; use dotnet publish to generate compressed copies. See MSBuild runtimes.

NoCompression still creates .br and .gz files. Use TwoDogWebPrecompress=false to skip generating them.

Trimming and AOT ​

The generated host preserves the game, host, GodotSharp, and twodog assemblies. Root other assemblies accessed only through reflection:

xml
<ItemGroup>
  <TrimmerRootAssembly Include="MyLibrary"/>
</ItemGroup>

Browser hosts run on Mono. Enable Mono's AOT compiler with -p:RunAOTCompilation=true; use this instead of PublishAot.

See the Web host guide for serving and deploying AppBundle/.