wasm-pack icon indicating copy to clipboard operation
wasm-pack copied to clipboard

Cache optimization with `wasm-opt`

Open kartva opened this issue 3 years ago • 7 comments

Rebuilding a project with wasm-pack right now can take a (relatively) long time because wasm-opt is run every time by default to optimize the produced WebAssembly binaries, since the default configuration for wasm-pack build is --release.

Hashing the source files (or webassembly binaries) and only running wasm-opt in case their checksum changed would be nice.

Somewhat unrelated: Why is the default for wasm-pack build release mode when cargo has debug as the default mode?

kartva avatar Jun 23 '22 12:06 kartva

When I went to work on this, it turns out it's quite hard to work in dev mode with optimization - I've raised an issue (#1218) for this.

tristan-f-r avatar Feb 01 '23 22:02 tristan-f-r

Would be it be possible to implement this at least for non-debug builds? Happy to look more into this myself.

elijah-potter avatar Feb 14 '23 23:02 elijah-potter