WASM-MERGE(1)
π NAME π
okay bestie, welcome to wasm-merge π
β it's a User Commands manual page (section 1, obvs), and it does exactly one iconic thing: merges wasm files into one. that's the whole gig. slay.
π¦ DESCRIPTION π¦
================================================================================
wasm-merge INFILE1 NAME1 INFILE2 NAME2 [..]
so like. merge wasm files into one. that's it, that's the vibe β¨
for example, bestie:
wasm-merge foo.wasm foo bar.wasm bar -o merged.wasm
this will read foo.wasm and bar.wasm, with names foo and bar respectively π«Ά so if the second one imports from foo, we will see that as an import from the first module after the merge. and the merged output? written to merged.wasm. iconic.
not me β note that filenames and modules names are interleaved (which is hopefully less confusing) π so yeah, keep your eyes on the pattern: file, name, file, name.
input source maps can be specified by adding an -ism option right after the module name:
wasm-merge foo.wasm foo -ism foo.wasm.map ...
================================================================================
β¨ wasm-merge options β¨
--output,-oβ the output file πΎ--input-source-map,-ismβ consume source maps from the specified files πΊοΈ--output-source-map,-osmβ emit source map to the specified file--output-source-map-url,-osuβ emit specified string as source map URL π--output-manifestβ write a wasm-split manifest to the specified file. this manifest can be given towasm-splitto split the merged module along the lines of the original modules. implies--debuginfoto preserve function names in the output module π§Ύ--rename-export-conflicts,-recβ rename exports to avoid conflicts (rather than error) π·οΈ--skip-export-conflicts,-secβ skip exports that conflict with previous ones π--emit-text,-Sβ emit text instead of binary for the output file π--debuginfo,-gβ emit names section and debug info π
π§ Tool options π§
--mvp-features,-mvpβ disable all non-MVP features π«--all-features,-allβ enable all features π--detect-featuresβ (deprecated - this flag does nothing) π--quiet,-qβ emit less verbose output and hide trivial warnings. π€«--experimental-poppyβ parse wast files as Poppy IR for testing purposes. πΈ--emit-module-namesβ emit module names, even if not emitting the rest of the names section. π·οΈ--enable-sign-extβ enable sign extension operations--disable-sign-extβ disable sign extension operations--enable-threadsβ enable atomic operations βοΈ--disable-threadsβ disable atomic operations--enable-mutable-globalsβ enable mutable globals--disable-mutable-globalsβ disable mutable globals--enable-nontrapping-float-to-intβ enable nontrapping float-to-int operations--disable-nontrapping-float-to-intβ disable nontrapping float-to-int operations--enable-simdβ enable SIMD operations and types--disable-simdβ disable SIMD operations and types--enable-bulk-memoryβ enable bulk memory operations--disable-bulk-memoryβ disable bulk memory operations--enable-bulk-memory-optβ enablememory.copyandmemory.fill--disable-bulk-memory-optβ disablememory.copyandmemory.fill--enable-call-indirect-overlongβ enable LEB encoding of call-indirect (Ignored for compatibility as it has no effect on Binaryen)--disable-call-indirect-overlongβ disable LEB encoding of call-indirect (Ignored for compatibility as it has no effect on Binaryen)--enable-exception-handlingβ enable exception handling operations π¨--disable-exception-handlingβ disable exception handling operations--enable-tail-callβ enable tail call operations--disable-tail-callβ disable tail call operations--enable-reference-typesβ enable reference types--disable-reference-typesβ disable reference types--enable-multivalueβ enable multivalue functions--disable-multivalueβ disable multivalue functions--enable-gcβ enable garbage collection ποΈ--disable-gcβ disable garbage collection--enable-memory64β enable memory64--disable-memory64β disable memory64--enable-relaxed-simdβ enable relaxed SIMD π--disable-relaxed-simdβ disable relaxed SIMD--enable-extended-constβ enable extended const expressions--disable-extended-constβ disable extended const expressions--enable-stringsβ enable strings π§΅--disable-stringsβ disable strings--enable-multimemoryβ enable multimemory--disable-multimemoryβ disable multimemory--enable-stack-switchingβ enable stack switching π₯--disable-stack-switchingβ disable stack switching--enable-shared-everythingβ enable shared-everything threads--disable-shared-everythingβ disable shared-everything threads--enable-fp16β enable float 16 operations--disable-fp16β disable float 16 operations--enable-custom-descriptorsβ enable custom descriptors (RTTs) and exact references--disable-custom-descriptorsβ disable custom descriptors (RTTs) and exact references--enable-multibyteβ enable multibyte array loads and stores--disable-multibyteβ disable multibyte array loads and stores--enable-relaxed-atomicsβ enable acquire/release atomic memory operations--disable-relaxed-atomicsβ disable acquire/release atomic memory operations--enable-custom-page-sizesβ enable custom page sizes π--disable-custom-page-sizesβ disable custom page sizes--enable-wide-arithmeticβ enable wide arithmetic--disable-wide-arithmeticβ disable wide arithmetic--enable-compact-importsβ enable compact import section--disable-compact-importsβ disable compact import section--enable-typed-function-referencesβ Deprecated compatibility flag β οΈ--disable-typed-function-referencesβ Deprecated compatibility flag β οΈ--no-validation,-nβ disables validation, assumes inputs are correct π³ (yes it just trusts you. bold of it. but ok.)--pass-arg,-paβ an argument passed along to optimization passes being run. must be in the formKEY@VALUE. ifKEYis the name of a pass then it applies to the closest instance of that pass before us. ifKEYis not the name of a pass then it is a global option that applies to all pass instances that read it. π--closed-world,-cwβ assume code outside of the module does not inspect or interact with GC and function references, even if they are passed out. the outside may hold on to them and pass them back in, but not inspect their contents or call them. πͺ--preserve-type-orderβ preserve the order of types from the input (useful for debugging and testing) π’--generate-stack-irβ generate StackIR during writing--optimize-stack-irβ optimize StackIR during writing--print-stack-irβ print StackIR during writing
π General options π
--versionβ output version information and exit π·οΈ--help,-hβ show this help message and exit π--debug,-dβ print debug information tostderrπ
and that's the whole page, bestie, you ate it π β¨π¦
this was wasm-merge version 131, from August 2026 β ty for coming to my ted talk, mwah π«Άπ
π¦ where this page comes from
- ubuntu stonking: binaryen 131-2 Β· Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms