mirror of
https://github.com/fluencelabs/wasm-bindgen
synced 2025-04-01 01:41:08 +00:00
This commit reverts part of the implementation of [RFC 6]. That RFC specified that the `--browser` flag was going to be repurposed for the new "natively loadable as ES module output", but unfortunately the breakage is far broader than initially expected. It turns out that `wasm-pack` passes `--browser` by default which means that a change to break `--browser` would break all historical versions of `wasm-pack` which is a bit much for now. To solve this the `--browser` flag is going back to what it represents on the current released version of `wasm-bindgen` (optimize away some node.js checks in a few places for bundler-style output) and a new `--web` flag is being introduced as the new deployment strategy. [RFC 6]: https://github.com/rustwasm/rfcs/pull/6 Closes #1318
18 lines
478 B
Markdown
18 lines
478 B
Markdown
# Without a Bundler
|
|
|
|
[View documentation for this example online][dox]
|
|
|
|
[dox]: https://rustwasm.github.io/wasm-bindgen/examples/without-a-bundler.html
|
|
|
|
You can build the example locally with:
|
|
|
|
```
|
|
$ 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 \
|
|
--web
|
|
```
|
|
|
|
and then opening `index.html` in a browser should run the example!
|