Add rlib to crate-type in Cargo.toml #177
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I've been learning wasm by game of life tutorial recently. The difference from the tutorial is that I use
rust-webpack-template
(this repo) instead ofwasm-pack-template
(https://github.com/rustwasm/wasm-pack-template).When I entered the
Testing life
section, I got a problem; I couldn't import things fromsrc/lib.rs
intests/app.rs
. For example, saysrc/lib.rs
has the following content:and
tests/app.rs
tries to importfoo
like this:then
use my_wasm_project::foo;
flags an error that says "unresolved importmy_wasm_project
".I was confused at first, and I tried to look into it, I found this comment in a cargo's issue. Then adding
rlib
to Cargo.toml, it all works fine.Moreover, Cargo.toml in
wasm-pack-template
actually specifiesrlib
. ref: https://github.com/rustwasm/wasm-pack-template/blob/master/Cargo.toml#L8I'd be happy to have this PR merged. Thank you :)