I'm writing an app that is comprised of two crates: the first crate is a standard binary which uses webview to load a yew project which is compiled as asm.js. The first binary crate uses an index.hml file and the compiled asm.js file.
How can I create a single workspace project and specify that the first crate should be compiled with cargo build and the second with cargo web build --target asmjs-unknown-emscripten? Currently, cargo builds both crates in the same way, causing the build of the second crate to fail.
Cargo will ignore the [build] key, unfortunately. The same incantation will work in .cargo/config, but Cargo appears to only respect the one it finds in the directory where it gets run (or above that in the hierarchy), and won't look inside crates in a workspace to find other configuration.
(I've been dealing with the same issue as @jon_black and I find the current situation very frustrating.)
For the wasm crate, use a shell script to cd into it and run wasm-pack build, which sets the target. (I don't believe wasm-pack supports emscripten, so you could do the same thing with cargo build --target (yourtarget).)