Skip to content

Commit

Permalink
Merge pull request #1382 from fitzgen/wasm-pack-web-target
Browse files Browse the repository at this point in the history
Use `wasm-pack build --target web` for without-a-bundler example
  • Loading branch information
alexcrichton committed Mar 21, 2019
2 parents d49d8c9 + 1e98f6b commit 93cab3d
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 13 deletions.
11 changes: 1 addition & 10 deletions examples/without-a-bundler/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,5 @@

set -ex

# Note that typically we'd use `wasm-pack` to build the crate, but the
# `--web` flag is very new to `wasm-bindgen` and as such doesn't have
# support in `wasm-pack` yet. Support will be added soon though!

cargo build --target wasm32-unknown-unknown --release
cargo run --manifest-path ../../crates/cli/Cargo.toml \
--bin wasm-bindgen -- \
../../target/wasm32-unknown-unknown/release/without_a_bundler.wasm --out-dir pkg \
--web

wasm-pack build --target web
python3 -m http.server
3 changes: 0 additions & 3 deletions guide/src/examples/without-a-bundler.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@ browser directly. For this deployment strategy bundlers like Webpack are not
required. For more information on deployment see the [dedicated
documentation][deployment].

> **Note**: the `--web` flag is quite new to `wasm-bindgen`, and does not
> currently have support in `wasm-pack` yet. Support will be added soon though!
First let's take a look at the code and see how when we're using `--web`
we're not actually losing any functionality!

Expand Down

0 comments on commit 93cab3d

Please sign in to comment.