2019-03-19 21:25:13 +03:00
|
|
|
# Without a Bundler Using `--target no-modules`
|
2019-02-25 22:11:30 +03:00
|
|
|
|
|
|
|
[View documentation for this example online][dox]
|
|
|
|
|
2019-05-26 10:43:00 +03:00
|
|
|
[dox]: https://rustwasm.github.io/docs/wasm-bindgen/examples/without-a-bundler.html
|
2019-02-25 22:11:30 +03:00
|
|
|
|
|
|
|
You can build the example locally with:
|
|
|
|
|
|
|
|
```
|
|
|
|
$ wasm-pack build --target no-modules
|
|
|
|
```
|
|
|
|
|
|
|
|
and then opening `index.html` in a browser should run the example!
|
2019-03-05 23:32:40 +03:00
|
|
|
|
|
|
|
Note that this example is in contrast to the [without a bundler][wab] example
|
2019-03-19 21:25:13 +03:00
|
|
|
which performs a similar purpose except it uses `--target no-modules` instead of
|
|
|
|
`--target web`. The main difference here is how the shim JS and module are
|
|
|
|
loaded, where this example uses old-school `script` tags while `--target web`
|
|
|
|
uses ES modules.
|
2019-03-05 23:32:40 +03:00
|
|
|
|
|
|
|
[wab]: https://github.com/rustwasm/wasm-bindgen/tree/master/examples/without-a-bundler
|