Part of my Cargo.toml for my crate:
[features]
wasm = ["ed25519-dalek/nightly", "rand/wasm-bindgen", "js-sys"]
This works, when the crate is used in another project, and the "wasm" feature is explicitly chosen.
I want to automatically enable this feature only when the target arch is WASM. I tried adding this:
#[cfg(target_arch = "wasm32")]
default = ["wasm"]
When I compile for a target other than WASM, "wasm" is included as the default, how can I make "wasm" the default only when the target is WASM?