webassembly size

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By sova2004

Hello everyone. Is there any way to reduce webassembly size?

I made simple scene, one small image 15kb and one script in few lines and web assembly takes near 27 Mb. The same image and script on Unity takes near 4,7 Mb (5,7 less size).

I made export with default settings on both engines.

:bust_in_silhouette: Reply From: Calinou

You can compile custom HTML5 export templates with unneeded features disabled. See Optimizing for size in the documentation.

Also, make sure to use a host that supports transparent gzip or Brotli compression. When applied to both the .wasm and .pck file, this will greatly decrease the download size. For instance, GitHub Pages supports this kind of compression but itch.io doesn’t.

In 3.2.4, HTML5 export templates will be faster and smaller since they’ll be compiled with link-time optimization by default. You can test this already in 3.2.4beta4. (Make a backup of your project before upgrading!)