wasm-pack
wasm-pack copied to clipboard
support custom profiles instead of the predefines
$ wasm-pack build --profile release-wasm
[INFO]: Checking for the Wasm target...
[INFO]: Compiling to Wasm...
error: conflicting usage of --profile=release-wasm and --release
The `--release` flag is the same as `--profile=release`.
Remove one flag or the other to continue.
Error: Compiling your crate to WebAssembly failed
Caused by: failed to execute `cargo build`: exited with exit status: 101
full command: "cargo" "build" "--lib" "--release" "--target" "wasm32-unknown-unknown" "--profile" "release-wasm"
+1
+1
This would be very useful for conditional compilation in staging environments, where binary size is still important but you need to do some extra logging for example.
Please implement this!
https://github.com/rustwasm/wasm-pack/blob/master/src/build/mod.rs#L103-L105 it looks like they don't specify a profile if you run wasm-pack
with --dev
edit: https://github.com/rustwasm/wasm-pack/blob/b9b38890cf47074417c76b6d19f08a2682f4207b/src/build/mod.rs#L103-L105
https://github.com/rustwasm/wasm-pack/blob/master/src/build/mod.rs#L103-L105 it looks like they don't specify a profile if you run wasm-pack with --dev
Unfortunately, that will also cause wasm-pack to use the debug target directory.
https://github.com/rustwasm/wasm-pack/blob/master/src/bindgen.rs#L26-L29