Skip to content

yew framework: I think i want to run wasm-pack from build.rs #916

Open
@Tanja-4732

Description

@Tanja-4732

I think i want to run web-pack from build.rs.
I have a workspace of multiple crates. The WebAssembly generating crate is just one of them.
I'd like to have one command to build everything, ideally cargo build.

Any advice on how to call wasm-pack build --target web in the one crate from the workspace's cargo build?

Originally posted by @kud1ing in #251 (comment)

Using Yew

I'm using the yew framework, and I'm working inside of a Rust workspace. Since the backend/ folder contains a bin crate for the backend server, and the frontend/ folder contains a yew project (which needs wasm-pack build --target web --out-name wasm --out-dir ../target/static or something like that to be run to compile to webassembly), I'd like to be able to do so in an automated fashion (ideally using cargo build in the root of the repo).

How should this be achieved?
If possible, integration with VS Code tasks is also desired.

Thanks for reading 🤗

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions