Packaging, Distribution and Deployment
wasm-pack publish, AssemblyScript packages, Emscripten modularized ES modules. Include .wasm in files. Use exports maps for browser/node.
Bundlers (Vite, webpack, Rollup, esbuild) with Wasm plugins. Serve with application/wasm and Brotli. Set long-cache headers with hashed filenames.
cdn.jsdelivr.net/unpkg for npm-published Wasm WASI binaries runnable via Wasmtime/Wasmer, or packaged as native executables (wasmer create-exe)
OCI registries (wkg oci push ghcr.io/org/comp:1.0), Wasm package registries FROM scratch Wasm images (Module 39)
spin deploy, wrangler deploy (Cloudflare), fastly compute publish
Ship .wasm files with a manifest (Extism, Zed extensions, proxy-wasm via OCI)
# nginx: correct MIME type, compression, and isolation headers
types { application/wasm wasm; }
location ~ \.wasm$ {
add_header Cache-Control "public, max-age=31536000, immutable";
add_header Cross-Origin-Opener-Policy same-origin;
add_header Cross-Origin-Embedder-Policy require-corp;
brotli_static on;
}