Switch the --browser argument to --web

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
This commit is contained in:
Alex Crichton
2019-03-07 07:33:40 -08:00
parent 79a8c5d27c
commit cd3781cb73
12 changed files with 70 additions and 45 deletions

View File

@ -108,7 +108,7 @@ fn rmain() -> Result<(), Error> {
let mut b = Bindgen::new();
b.debug(debug)
.nodejs(node)?
.browser(!node)?
.web(!node)?
.input_module(module, wasm)
.keep_debug(false)
.emit_start(false)