-
Notifications
You must be signed in to change notification settings - Fork 33
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
Referencing a crate in the parent directory as ../
fails
#22
Comments
+1 of appreciation, just hit the same issue. |
Yeah. I went down a rabbit hole upon finding this issue. Really it can be fixed by using But I saw a whole bunch of stuff I wanted to do differently and forked off. We'll see if it ends up merged back into this repo or if I publish with a different name; but check it out. https://github.com/Identikey/vite-plugin-wasm-pack It runs the wasm-pack command for you and then loads it directly. |
The error given is
and the contents of
my-crate/pkg
are copied to tomy-crate/www
, which results inpackage.json
being overridden.I've found two workarounds to this; the first is to go up another directory and then name the directory that you came from, which may not work if the crate is also the root of the repo and the repo folder was named differently than expected; the second workaround is to use node's
path.resolve
method to get an absolute path to../
.My guess as to why this is a problem is because you're expecting the name of the crate in the last segment of the path?
I've made a minimal reproducible example here: https://github.com/chinoto/mre_vite-plugin-wasm-pack_outside/tree/Fail
My workarounds are the last two commits of the master branch: https://github.com/chinoto/mre_vite-plugin-wasm-pack_outside/commits/master
The text was updated successfully, but these errors were encountered: