diff --git a/examples/without-a-bundler-no-modules/README.md b/examples/without-a-bundler-no-modules/README.md index f877bf8d..fca671d5 100644 --- a/examples/without-a-bundler-no-modules/README.md +++ b/examples/without-a-bundler-no-modules/README.md @@ -1,4 +1,4 @@ -# Without a Bundler +# Without a Bundler Using `--no-modules` [View documentation for this example online][dox] @@ -11,3 +11,11 @@ $ wasm-pack build --target no-modules ``` and then opening `index.html` in a browser should run the example! + +Note that this example is in contrast to the [without a bundler][wab] example +which performs a similar purpose except it uses `--no-modules` instead of +`--browser`. The main difference here is how the shim JS and module are loaded, +where this example uses old-school `script` tags while `--browser` uses ES +modules. + +[wab]: https://github.com/rustwasm/wasm-bindgen/tree/master/examples/without-a-bundler diff --git a/examples/without-a-bundler/README.md b/examples/without-a-bundler/README.md index 3bd88d71..ef469cef 100644 --- a/examples/without-a-bundler/README.md +++ b/examples/without-a-bundler/README.md @@ -7,7 +7,11 @@ You can build the example locally with: ``` -$ ./build.sh +$ cargo build --target wasm32-unknown-unknown --release +$ cargo run -p wasm-bindgen-cli --bin wasm-bindgen -- \ + ../../target/wasm32-unknown-unknown/release/without_a_bundler.wasm \ + --out-dir pkg \ + --browser ``` and then opening `index.html` in a browser should run the example!