Use the same profile name for both Cargo and wasm-pack
When running wasm-pack with a custom profile (wasm-pack build . --profile custom_profile_name), the Cargo profile with name custom_profile_name will be used, but wasm-pack will use a profile called custom.
More concisely,
Cargo will use [profile.custom_profile_name], whereas
wasm-pack will use [package.metadata.wasm-pack.profile.custom]
This PR makes wasm-pack use the custom profile name provided with the --profile option so that
wasm-pack will now use [package.metadata.wasm-pack.profile.custom_profile_name].
Closes #1488.
Make sure these boxes are checked! 📦✅
- [x] You have the latest version of
rustfmtinstalled
$ rustup component add rustfmt
- [x] You ran
cargo fmton the code base before submitting - [x] You reference which issue is being closed in the PR text
✨✨ 😄 Thanks so much for contributing to wasm-pack! 😄 ✨✨
To my knowledge the custom profile is currently undocumented, and the feature has not yet been released. But since some users is likely using the git repository to install wasm-pack, I added a deprecation warning for the custom profile. Is this desirable?
hey ! should this allow
[package.metadata.wasm-pack.profile.custom]
wasm-opt = ['-Oz', '--enable-bulk-memory']
and using --profile custom doesn't use the flags set