---
title: "wasmbuild - Using Rust in Deno and Web Apps"
description: "wasmbuild is a Deno-run CLI script that compiles Rust crates to WebAssembly via wasm-bindgen, generates JavaScript glue code with multiple loader strategies and lazy instantiation, and optimizes output with wasm-opt."
url: "https://swe.quest/articles/wasmbuild-using-rust-in-deno-and-web-apps-ea6b475b6d77519e"
canonical: "https://deno.com/blog/wasmbuild"
source: "Deno"
published: "2022-06-30"
difficulty: "medium"
kind: "How-to"
reading_minutes: 3
tags: ["webassembly","rust","javascript","build-systems"]
---

# wasmbuild - Using Rust in Deno and Web Apps

A post on [Deno](https://swe.quest/sources/deno.md), published 2022-06-30, 3 min read, How-to. Original: [https://deno.com/blog/wasmbuild](https://deno.com/blog/wasmbuild)

## Summary

wasmbuild is a Deno-run CLI script that compiles Rust crates to WebAssembly via wasm-bindgen, generates JavaScript glue code with multiple loader strategies and lazy instantiation, and optimizes output with wasm-opt. Unlike wasm-pack or wasm-bindgen-cli, it needs no globally installed tool beyond the Rust toolchain and Deno, and it targets Deno and browsers specifically. A walkthrough scaffolds a crate with \`deno task wasmbuild new\`, builds an \`add\` function, and calls it from Deno, a browser page, and Deno Deploy. URL-based Deploy deployments don't yet work because the .wasm file isn't part of the module graph.

Written by swe.quest, not by the author.

**Difficulty:** Medium: assumes a working developer; shows how it is built or done

## Topics

- [WebAssembly](https://swe.quest/tags/webassembly.md) (Languages)
- [Rust](https://swe.quest/tags/rust.md) (Languages)
- [JavaScript](https://swe.quest/tags/javascript.md) (Languages)
- [Build systems](https://swe.quest/tags/build-systems.md) (Engineering practices)

## Prerequisites

- Rust toolchain basics ([easy posts on Rust](https://swe.quest/tags/rust.md?difficulty=easy))
- JavaScript ES modules ([easy posts on JavaScript](https://swe.quest/tags/javascript.md?difficulty=easy))

## Keywords

wasmbuild, Deno, wasm-bindgen, wasm-opt, Deno Deploy, wasm-pack

## Related posts

- [Intro to Wasm in Deno](https://swe.quest/articles/intro-to-wasm-in-deno-e9e470adfcfab289.md): Deno · 2025-01-28 · Medium · 4 min read · WebAssembly, Rust, JavaScript
  Deno 2.1 lets Wasm modules be imported directly like JavaScript modules, with their exports understood and typechecked.
- [Deno 2.1: Wasm Imports and other enhancements](https://swe.quest/articles/deno-2-1-wasm-imports-and-other-enhancements-af4c182924b76014.md): Deno · 2024-11-21 · Medium · 17 min read · JavaScript, WebAssembly, Runtimes & VMs, Developer tools, Build systems
  Deno 2.1 lets Wasm modules be imported directly as ES modules.
- [Deno's Other Open Source Projects](https://swe.quest/articles/deno-s-other-open-source-projects-d23e8b3569399530.md): Deno · 2025-10-16 · Easy · 7 min read · Open source, Rust, Runtimes & VMs, JavaScript, Developer tools
  Deno publishes many MIT-licensed supporting libraries extracted from its runtime, most of them Rust crates.
- [Life of a Zed Extension: Rust, WIT, Wasm](https://swe.quest/articles/life-of-a-zed-extension-rust-wit-wasm-ec148b04db708b5a.md): Zed · 2024-10-21 · Medium · 21 min read · WebAssembly, Rust, Developer tools
  Zed extensions are written in Rust but never compiled on the user's machine.
- [Deno 1.12 Release Notes](https://swe.quest/articles/deno-1-12-release-notes-2fc6918341f284d0.md): Deno · 2021-07-13 · Medium · 12 min read · JavaScript, Runtimes & VMs, WebAssembly, TypeScript
  Deno 1.12 adds Web Crypto key generation, signing and verification, server-side WebSocket upgrades via Deno.upgradeWebSocket on the unstable native HTTP server, and TypeScript transpilation plus automatic static-to-dynamic import conversion in the REPL.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
