From 2b676226b6713ce67c0eb65239246262a657b7c8 Mon Sep 17 00:00:00 2001 From: josephrocca <1167575+josephrocca@users.noreply.github.com> Date: Fri, 23 Feb 2024 20:48:07 +0800 Subject: [PATCH 1/2] Add `--target web` to quick start build command --- docs/src/quickstart.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/src/quickstart.md b/docs/src/quickstart.md index 85927be2..3268b519 100644 --- a/docs/src/quickstart.md +++ b/docs/src/quickstart.md @@ -4,8 +4,9 @@ 1. [Install this tool.] 1. Run `wasm-pack new hello-wasm`. 1. `cd hello-wasm` -1. Run `wasm-pack build`. +1. Run `wasm-pack build --target web`. 1. This tool generates files in a `pkg` dir +1. Import it: `import init, { greet } from "./pkg/hello_wasm.js"`, initialize it: `await init()`, and then use it: `greet("WebAssembly")` 1. To publish to npm, run `wasm-pack publish`. You may need to login to the registry you want to publish to. You can login using `wasm-pack login`. From 4da7e4ae8c63f2e37151b63767cd0ec02deb81ae Mon Sep 17 00:00:00 2001 From: josephrocca <1167575+josephrocca@users.noreply.github.com> Date: Fri, 23 Feb 2024 20:52:34 +0800 Subject: [PATCH 2/2] Remove unused `greet` argument. --- docs/src/quickstart.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/src/quickstart.md b/docs/src/quickstart.md index 3268b519..c249123d 100644 --- a/docs/src/quickstart.md +++ b/docs/src/quickstart.md @@ -6,7 +6,7 @@ 1. `cd hello-wasm` 1. Run `wasm-pack build --target web`. 1. This tool generates files in a `pkg` dir -1. Import it: `import init, { greet } from "./pkg/hello_wasm.js"`, initialize it: `await init()`, and then use it: `greet("WebAssembly")` +1. Import it: `import init, { greet } from "./pkg/hello_wasm.js"`, initialize it: `await init()`, and then use it: `greet()` 1. To publish to npm, run `wasm-pack publish`. You may need to login to the registry you want to publish to. You can login using `wasm-pack login`.