trunk icon indicating copy to clipboard operation
trunk copied to clipboard

Include optional wasm-opt execution in release builds

Open lpotthast opened this issue 4 years ago • 1 comments

Running wasm-opt (from https://github.com/WebAssembly/binaryen) with option "-O2" on a generated wasm file build with the --release flag, shrinks the size of it quite significantly. In my case from ~2.6mb to ~1.9mb.

Would it be possible to, optionally, regarding the time overhead induced, include the execution of the wasm-opt tool in the build command, so that smaller and possibly more performant binaries can be generated by default?

Having a "as small as possible" wasm file should be desired in the web-landscape.

lpotthast avatar Apr 23 '22 13:04 lpotthast

This is already possible. See https://trunkrs.dev/assets/#rust with data-wasm-opt

lukechu10 avatar Apr 23 '22 20:04 lukechu10

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.

github-actions[bot] avatar Oct 02 '23 00:10 github-actions[bot]