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

support custom profiles instead of the predefines

Open liuhongxuan23 opened this issue 2 years ago • 6 comments

$ 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"

liuhongxuan23 avatar Feb 12 '22 09:02 liuhongxuan23

+1

fbjork avatar Mar 29 '22 11:03 fbjork

+1

babymotte avatar Jul 30 '22 06:07 babymotte

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.

mitiko avatar Sep 21 '23 18:09 mitiko

Please implement this!

float3 avatar Feb 18 '24 22:02 float3

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

float3 avatar Feb 18 '24 22:02 float3

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

net avatar Mar 01 '24 23:03 net