-
Notifications
You must be signed in to change notification settings - Fork 409
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
--target-dir causes build errors when used in workspace #1252
Comments
dfaust
added a commit
to dfaust/wasm-pack
that referenced
this issue
Sep 22, 2023
dfaust
added a commit
to dfaust/wasm-pack
that referenced
this issue
Sep 22, 2023
Is there any easy workaround for this? |
Fixed in #1331. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
🐛 Bug description
I have a workspace which contains both WASM and non-WASM binaries. I find that using the default target directory in the workspace root for both types of binary seems to thrash the target cache and cause unnecessary recompilations, so I'd like to compile the WASM binaries to a different directory. One WASM binary is in
{workspace_root}/crates/binary/user_interface_wasm
.For reference, my default wasm-pack invocation is:
wasm-pack build crates/binary/user_interface_wasm --dev -t web --no-typescript
This works, but thrashes the cache:
When I pass a --target-dir:
wasm-pack build crates/binary/user_interface_wasm --dev -t web --no-typescript --target-dir target-web
It builds the WASM app in
crates/binary/user_interface_wasm/target-web
rather than{workspace_root}/target-web
. I guess that's fine, but it also errors, seemingly because it's looking for the built binary in the wrong place:Passing a target-dir that puts the build directory at the workspace root is a bit nicer place for it:
wasm-pack build crates/binary/user_interface_wasm --dev -t web --no-typescript --target-dir ../../../target-web
But also fails with a similar error:
🤔 Expected Behavior
The WASM app should still be built and copied to user_interface_wasm/pkg with either of the last two commands above.
👟 Steps to reproduce
See above.
🌍 Your environment
Include the relevant details of your environment.
wasm-pack version: wasm-pack 0.11.0
rustc version: rustc 1.70.0-nightly (44f518058 2023-03-20)
Thanks!
The text was updated successfully, but these errors were encountered: