Skip to content

snizu function build

Compile a function to WebAssembly with its language's own tools, and refuse a module bigger than the platform takes, while that's still cheap to find out.

Node 22+1 min read

Usage

Usage
snizu function build [dir]

Flags

  • [dir]path
    The function's folder, with its snizu.function.json. The current one by default.

What it runs

  • Rust
    cargo build --release --target wasm32-wasip1, then copies the module. Install Rust from rustup.rs, then rustup target add wasm32-wasip1.
  • JavaScript
    javy build index.js -o dist/function.wasm. Install Javy from its GitHub releases.

Either way the module is dist/function.wasm. The platform takes modules up to 256 KB, and the build fails on a bigger one: build with fewer dependencies.

Examples

Terminal
$ snizu function build
✓ Built dist/function.wasm (182 KB).
Terminal
$ snizu function build
✗ Javy isn't installed. Get it from github.com/bytecodealliance/javy, then build again.

Was this page helpful?

Updated 25 Nov 2026