Skip to content

Commit b5e377d

Browse files
enhance wasm-bindgen installation doc (#2171)
1 parent 87663c6 commit b5e377d

File tree

1 file changed

+19
-5
lines changed

1 file changed

+19
-5
lines changed

guide/src/reference/cli.md

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,25 @@ always be listed via `wasm-bindgen --help`.
1313

1414
The recommend way to install the `wasm-bindgen` command line tool is with the
1515
`wasm-pack` installer described
16-
[here](https://rustwasm.github.io/wasm-pack/installer/). After installing
17-
`wasm-pack`, run `wasm-pack build` to install the command line tool. (Although
18-
the command line tool is available through its own crate, `wasm-bindgen-cli`,
19-
`wasm-pack build` will ensure the version installed matches the version of
20-
`wasm-bindgen` in `Cargo.lock`.)
16+
[here](https://rustwasm.github.io/wasm-pack/installer/). After installing
17+
`wasm-pack`, you are ready to build project invoking `wasm-pack build`.
18+
This command installs apropriate version of the `wasm-bindgen` command-line
19+
tool. The version of `wasm-bindgen` installed by `wasm-pack` is not available
20+
to be used directly via command line.
21+
22+
It is not recommended to install `wasm-bindgen-cli` as its version must match
23+
_exactly_ the version of `wasm-bindgen` that is specified in the project's
24+
cargo.lock file. Using `wasm-pack` for building simplifies the build process
25+
as `wasm-pack` ensures that the proper version of `wasm-bindgen` command-line
26+
tool is used. That means that `wasm-pack` may install many different versions
27+
of `wasm-bindgen`, but during the build `wasm-pack` will always make sure to
28+
use the correct one.
29+
30+
Note: if, for any reason, you decide to use wasm-bindgen directly (this is
31+
not recommended!) you will have to manually take care of using exactly the
32+
same version of wasm-bindgen command-line tool (wasm-bindgen-cli) that
33+
matches the version of wasm-bingden in cargo.lock.
34+
2135

2236
## Usage
2337

0 commit comments

Comments
 (0)