Skip to content

enhance wasm-bindgen installation doc #2171

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

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 19 additions & 5 deletions guide/src/reference/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,25 @@ always be listed via `wasm-bindgen --help`.

The recommend way to install the `wasm-bindgen` command line tool is with the
`wasm-pack` installer described
[here](https://rustwasm.github.io/wasm-pack/installer/). After installing
`wasm-pack`, run `wasm-pack build` to install the command line tool. (Although
the command line tool is available through its own crate, `wasm-bindgen-cli`,
`wasm-pack build` will ensure the version installed matches the version of
`wasm-bindgen` in `Cargo.lock`.)
[here](https://rustwasm.github.io/wasm-pack/installer/). After installing
`wasm-pack`, you are ready to build project invoking `wasm-pack build`.
This command installs apropriate version of the `wasm-bindgen` command-line
tool. The version of `wasm-bindgen` installed by `wasm-pack` is not available
to be used directly via command line.

It is not recommended to install `wasm-bindgen-cli` as its version must match
_exactly_ the version of `wasm-bindgen` that is specified in the project's
cargo.lock file. Using `wasm-pack` for building simplifies the build process
as `wasm-pack` ensures that the proper version of `wasm-bindgen` command-line
tool is used. That means that `wasm-pack` may install many different versions
of `wasm-bindgen`, but during the build `wasm-pack` will always make sure to
use the correct one.

Note: if, for any reason, you decide to use wasm-bindgen directly (this is
not recommended!) you will have to manually take care of using exactly the
same version of wasm-bindgen command-line tool (wasm-bindgen-cli) that
matches the version of wasm-bingden in cargo.lock.


## Usage

Expand Down