From b5e377da784f209911689a53ea906f08b0dd2302 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maciek=20Tala=C5=9Bka?= Date: Fri, 29 May 2020 22:17:01 +0200 Subject: [PATCH] enhance wasm-bindgen installation doc (#2171) --- guide/src/reference/cli.md | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/guide/src/reference/cli.md b/guide/src/reference/cli.md index 51409273..0477d04b 100644 --- a/guide/src/reference/cli.md +++ b/guide/src/reference/cli.md @@ -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