| Crates.io | worker-build |
| lib.rs | worker-build |
| version | 0.7.4 |
| created_at | 2021-09-02 16:28:20.300929+00 |
| updated_at | 2026-01-15 20:37:04.024524+00 |
| description | This is a tool to be used as a custom build command for a Cloudflare Workers `workers-rs` project. |
| homepage | |
| repository | https://github.com/cloudflare/workers-rs/tree/main/worker-build |
| max_upload_size | |
| id | 446061 |
| size | 176,514 |
This is a tool to be used as a custom build command for a Cloudflare Workers project.
# wrangler.toml
# ...
[build]
command = "cargo install -q worker-build && worker-build --release"
[build.upload]
dir = "build/worker"
format = "modules"
main = "./shim.mjs"
[[build.upload.rules]]
globs = ["**/*.wasm"]
type = "CompiledWasm"
You can override the default binary lookup/download behavior by setting these environment variables:
WASM_BINDGEN_BIN: Path to a custom wasm-bindgen binary. When set, worker-build will use this binary instead of downloading or looking for a globally installed version.
WASM_OPT_BIN: Path to a custom wasm-opt binary. When set, worker-build will use this binary instead of downloading one.
export WASM_BINDGEN_BIN=/path/to/custom/wasm-bindgen
export WASM_OPT_BIN=/path/to/custom/wasm-opt
worker-build --release