Cache optimization with `wasm-opt`
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 buildrelease mode whencargohasdebugas the default mode?
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.
Would be it be possible to implement this at least for non-debug builds? Happy to look more into this myself.