Skip to content

Commit 5d52bf8

Browse files
committed
Document --no-modules in the README
1 parent 8854936 commit 5d52bf8

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -540,6 +540,13 @@ some notable options are:
540540
making it incompatible with Node. This will basically make the generated JS a
541541
tiny bit smaller as runtime checks for Node won't be necessary.
542542

543+
* `--no-modules` - the default output of `wasm-bindgen` uses ES modules but this
544+
option indicates that ES modules should not be used and output should be
545+
tailored for a web browser. In this mode `window.wasm_bindgen` will be a
546+
function that takes a path to the wasm file to fetch and instantiate.
547+
Afterwards exported functions from the wasm are available through
548+
`window.wasm_bindgen.foo`.
549+
543550
* `--typescript` - when passed a `*.d.ts` file will be generated for the
544551
generated JS file. This should allow hooking into TypeScript projects to
545552
ensure everything still typechecks.

0 commit comments

Comments
 (0)