Commands
wasm-split
Add build ids to WebAssembly modules and split out debug data
sentry wasm-split <input>
Section titled “sentry wasm-split <input>”Add build ids to WebAssembly modules and split out debug data
Arguments:
| Argument | Description |
|---|---|
<input> |
Path to the wasm file |
Options:
| Option | Description |
|---|---|
-o, --out <out> |
Path to the output wasm file (default: modify input in place) |
-d, --debug-out <debug-out> |
Path to the output debug wasm file (default: debug data stays in the input) |
--strip |
Strip the file of debug info |
--strip-names |
Strip the file of symbol names (only with --strip) |
-q, --quiet |
Do not print the build id |
--build-id <build-id> |
Explicit build id to use, as a UUID |
--external-dwarf-url <external-dwarf-url> |
URL for browsers to fetch the separate DWARF debug symbol file |
All commands support --json for machine-readable output and --fields to select specific JSON fields.
Examples
Section titled “Examples”# Add a build id to a module, in place, and print itsentry wasm-split app.wasm
# Capture the build id for a later uploadBUILD_ID=$(sentry wasm-split app.wasm)
# Split debug data into a companion and ship a stripped binarysentry wasm-split app.wasm --debug-out app.debug.wasm --strip
# Also drop function names from the shipped binarysentry wasm-split app.wasm -d app.debug.wasm --strip --strip-names
# Point browsers at a companion served from a CDNsentry wasm-split app.wasm -o dist/app.wasm -d dist/app.debug.wasm --strip \ --external-dwarf-url https://cdn.example.com/debug/app.debug.wasmImportant Notes
Section titled “Important Notes”- This is a drop-in replacement for Symbolicator's
wasm-splitbinary — same flags, same behaviour, same output. - Only the build id is printed, as lowercase hex, so it can be captured in
a shell variable. Pass
--quietto print nothing.--quietcannot be combined with--json. - A build id the module already carries is reused. Rewriting it would
orphan debug files uploaded against the old one.
--build-idapplies only when the module has none. - The debug companion is a complete copy of the module, captured before stripping. DWARF offsets are relative to the code section, so a companion missing it cannot be symbolicated. Expect it to be about the size of the input.
--strip-namestakes effect only alongside--strip.external_debug_infois written when--external-dwarf-urlis given, or else from the basename of--debug-out. A bare filename resolves relative to the main wasm file, which is how Emscripten reads it.- The file is left untouched when nothing changed — no new build id, no
stripping, no
external_debug_info— so reruns do not disturb build caches.