Cargo wasm build using subcommand


My project consists of two components. The directory tree looks like this:

├── Cargo.lock
├── Cargo.toml
├── client
│   ├── Cargo.toml
│   └── src
│       └──
└── server
    ├── Cargo.toml
    └── src

The top-level Cargo.toml is simply a workspace:

members = [ "server", "client" ]`

client is an stdweb project, which needs to be built using the Cargo subcommand cargo web build.

server is compiled as usual, using cargo build.

What is the best way to set this up? I want the whole workspace to build correctly when I simply issue a top-level cargo build command.

Do I need to write a script for the client, or is there an easier way to accomplish this, since I’m still compiling Rust code?



Seems to be a fundamental limitation of the tool. More discussion here: