Skip to content

Search

Zurück
· 2 Min. Lesezeit

A smaller web template

A web export ships a template without the editor, the Rune compiler, the WESL linker or egui's fonts: 18.9 MB raw and 5.1 MB brotli.

A web export ships a template built without the editor: 18.9 MB raw and 5.1 MB brotli, where the editor's module is 25.4 MB and 7.0 MB.

Raw and brotli sizes of the editor's module, the game template, and the template without each physics world

  • A web export ships compiled scripts, as every other target does; the template has no Rune compiler: 1.0 MB.
  • Every shader the game draws with is linked at export and deflated into the pack, 9 KB for a game with no materials of its own, so the template has no WESL linker: 1.4 MB.
  • The exporter, the project store and a tab's editor entry points stay behind the editor feature: 0.4 MB.
  • egui's bundled faces stay in the editor too, behind fallback-fonts: 1.4 MB. A game draws with its own fonts/ and the Source Sans 3 face the engine carries.
  • Images decode as the seven formats a material and a sky read: PNG, JPEG, WebP, BMP, TGA, HDR and EXR.
  • egui fills its glyphs with zeno, the rasteriser the engine's own text already links, in place of vello_cpu: 1.4 MB, and half the time per glyph.
  • physics2d and physics3d each register one world, and [export] runtime = "2d" puts a game on its target's one-world template: web-2d is 17.1 MB raw and 4.7 MB brotli.
  • The export refuses it for a game using the other world.
  • [export] runtime = "bare" leaves out both worlds, auto picks it for a game naming neither, and web-bare is 10.38 MB raw, 2.98 MB brotli.
  • Packs carry compiled scripts, so the template drops its compiler, 0.49 MB.
  • Tony McMapface's 864 KiB tonemap table rides only in a pack naming tony_mcmapface: 350 KB more pack.
  • Web builds drop WebGL2 and RUST_LOG's regex and build std for size, 2.5 MB; webgl and WEB_STD=stock undo it.
  • --keep-sources ships source, which only a build with compile runs.
WEB_FEATURES=audio,browser,window,physics2d scripts/package_runtime.sh web
balaur export my-game --target web --runtime dist/balaur-runtime-web

The build size page has the table by crate.

Bist du sicher?