Skip to content
This repository was archived by the owner on Jul 19, 2020. It is now read-only.

Latest commit

 

History

History
35 lines (25 loc) · 1.19 KB

starter-templates.md

File metadata and controls

35 lines (25 loc) · 1.19 KB

Starter Templates

wasm-pack

The important distinction between these templates and using cargo-web is that this approach uses a lib, not a bin crate, and the entry-point to your program is annotated with a #[wasm_bindgen] annotation.

Your Cargo.toml also should specify that you have a "cdylib" crate-type.

{% code title="Cargo.toml" %}

[package]
name = "yew-app"
version = "0.1.0"
authors = ["Yew App Developer <[email protected]>"]
edition = "2018"

[lib]
crate-type = ["cdylib"]

[dependencies]
# for web_sys
yew = 0.15
# or for stdweb
# yew = { version = "0.15", package = "yew-stdweb" }
wasm-bindgen = "0.2"

{% endcode %}

Other templates