Frameworks
Wire wasmpeg into your stack — Vite, Next.js, Vue, Svelte, or Node — with the install, the one WASM-serving gotcha, and a working example for each.
The API is the same everywhere; only the wiring differs. Pick your stack below. The one thing
that trips people up in every bundler is serving the .wasm — the package’s dist/cpu.js
loads cpu.wasm from the same directory, so if your tool doesn’t co-locate them, copy the
binaries into your static folder and pass an explicit wasmPath.
The WASM-serving rule, once
Whatever the framework, the fix for a cpu.wasm 404 is identical: make sure the .wasm sits
next to the .js that loads it. Either let the bundler co-locate them (Vite does), or copy
node_modules/wasmpeg/dist/cpu.* into your static directory and pass
load({ wasmPath: '/your/path/cpu.js' }). See
Troubleshooting if it still doesn’t resolve.