Skip to main content

build_example

Function build_example 

Source
pub fn build_example(
    example: &Example,
    cargo_args: &[String],
    out: &Path,
) -> Result<(), String>
Expand description

Compile one example for wasm32-unknown-unknown, and bindgen it.

The build goes through PROFILE, so a browser is handed a small wasm rather than a debug one that takes minutes to compile and several times the size to fetch.

Shared with cargo xtask test-wasm, which loads the same pages: writing them here keeps the pages under test identical to the ones run-wasm serves.