wasm-bindgen/examples/without-a-bundler
Alex Crichton b762948456 Implement the local JS snippets RFC
This commit is an implementation of [RFC 6] which enables crates to
inline local JS snippets into the final output artifact of
`wasm-bindgen`. This is accompanied with a few minor breaking changes
which are intended to be relatively minor in practice:

* The `module` attribute disallows paths starting with `./` and `../`.
  It requires paths starting with `/` to actually exist on the filesystem.
* The `--browser` flag no longer emits bundler-compatible code, but
  rather emits an ES module that can be natively loaded into a browser.

Otherwise be sure to check out [the RFC][RFC 6] for more details, and
otherwise this should implement at least the MVP version of the RFC!
Notably at this time JS snippets with `--nodejs` or `--no-modules` are
not supported and will unconditionally generate an error.

[RFC 6]: https://github.com/rustwasm/rfcs/pull/6

Closes #1311
2019-03-05 08:00:47 -08:00
..
src Tweak introductory and deployment documentation. 2019-02-22 07:50:32 -08:00
build.sh Implement the local JS snippets RFC 2019-03-05 08:00:47 -08:00
Cargo.toml Bump to 0.2.38 2019-03-04 09:11:23 -08:00
index.html Implement the local JS snippets RFC 2019-03-05 08:00:47 -08:00
README.md Implement the local JS snippets RFC 2019-03-05 08:00:47 -08:00

Without a Bundler

View documentation for this example online

You can build the example locally with:

$ ./build.sh

and then opening index.html in a browser should run the example!