I want to compile a .rs file in a Rust lib to a .wasm.
RUSTFLAGS='-C link-arg=-s' cargo build --release --target wasm32-unknown-unknown
Instead of a .wasm file I get a .Rlib and .d file. What do I need to change to get a .wasm?
rustc considers .wasm files to fill the “native dynamic library” role in the WASM target. Add this to your Cargo.toml configuration to request that build instead of the default .rlib:
[lib]
crate-type = ["cdylib"]
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With