Skip to main content

run_wasm_pack_build

Function run_wasm_pack_build 

Source
pub async fn run_wasm_pack_build(
    path: &Path,
    target: &str,
    release: bool,
    out_dir: Option<&Path>,
    profiling: bool,
) -> Result<(), String>
Expand description

Run wasm-pack build

This wraps the wasm-pack CLI tool to build Rust projects for WASM.

§Arguments

  • path - Directory containing Cargo.toml
  • target - WASM target (web, bundler, nodejs, no-modules)
  • release - Build in release mode
  • out_dir - Output directory (default: pkg)
  • profiling - Enable profiling (adds names section)

§Errors

Returns an error if wasm-pack is not installed or build fails.