diff --git a/index.html b/index.html index 2b60b46d..19e8a922 100644 --- a/index.html +++ b/index.html @@ -141,6 +141,10 @@

- JavaScript interoperability +
+ - Library crate +
+
@@ -233,7 +237,18 @@

JavaScript interoperability

include all JavaScript snippets generated by wasm-bindgen for interfacing with JavaScript functionality.

By default, functions exported from Rust, using wasm-bingen, can be accessed in the JavaScript code through the global variable window.wasmBindings. This behavior can be disabled, and the name can be customized.

-

Next Steps

+

Library crate

+

Aside from having a main function, it is also possible to up your project as a cdylib project. In order to do that, +add the following to your Cargo.toml:

+
+[lib]
+crate-type = ["cdylib", "rlib"]
+
+

And then, define the entrypoint in your lib.rs like (does not need to be async):

+
+#[wasm_bindgen(start)]
+pub async fn run() {}
+

Next Steps

That's not all! Trunk has even more useful features. Head on over to the following sections to learn more about how to use Trunk effectively.