Scroll to navigation

WASM-MERGE(1) User Commands WASM-MERGE(1)

NAME

wasm-merge - manual page for wasm-merge 122

DESCRIPTION

================================================================================ wasm-merge INFILE1 NAME1 INFILE2 NAME2 [..]

Merge wasm files into one.

For example,

wasm-merge foo.wasm foo bar.wasm bar -o merged.wasm

will read foo.wasm and bar.wasm, with names 'foo' and 'bar' respectively, so if the second imports from 'foo', we will see that as an import from the first module after the merge. The merged output will be written to merged.wasm.

Note that filenames and modules names are interleaved (which is hopefully less confusing).

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 file (stdout if not specified)
Consume source maps from the specified files
Emit source map to the specified file
Emit specified string as source map URL
Rename exports to avoid conflicts (rather than error)
Skip exports that conflict with previous ones
Emit text instead of binary for the output file
Emit names section and debug info

Tool options: -------------

Disable all non-MVP features
Enable all features
(deprecated - this flag does nothing)
Emit less verbose output and hide trivial warnings.
Parse wast files as Poppy IR for testing purposes.
Enable sign extension operations
Disable sign extension operations
Enable atomic operations
Disable atomic operations
Enable mutable globals
Disable mutable globals
Enable nontrapping float-to-int operations
Disable nontrapping float-to-int operations
Enable SIMD operations and types
Disable SIMD operations and types
Enable bulk memory operations
Disable bulk memory operations
Enable memory.copy and memory.fill
Disable memory.copy and memory.fill
Enable LEB encoding of call-indirect (Ignored for compatibility as it has no effect on Binaryen)
Disable LEB encoding of call-indirect (Ignored for compatibility as it has no effect on Binaryen)
Enable exception handling operations
Disable exception handling operations
Enable tail call operations
Disable tail call operations
Enable reference types
Disable reference types
Enable multivalue functions
Disable multivalue functions
Enable garbage collection
Disable garbage collection
Enable memory64
Disable memory64
Enable relaxed SIMD
Disable relaxed SIMD
Enable extended const expressions
Disable extended const expressions
Enable strings
Disable strings
Enable multimemory
Disable multimemory
Enable stack switching
Disable stack switching
Enable shared-everything threads
Disable shared-everything threads
Enable float 16 operations
Disable float 16 operations
Deprecated compatibility flag
Deprecated compatibility flag
Disables validation, assumes inputs are correct
An argument passed along to optimization passes being run. Must be in the form KEY@VALUE. If KEY is the name of a pass then it applies to the closest instance of that pass before us. If KEY is not the name of a pass then it is a global option that applies to all pass instances that read it.
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 the order of types from the input (useful for debugging and testing)
generate StackIR during writing
optimize StackIR during writing
print StackIR during writing

General options: ----------------

Output version information and exit
Show this help message and exit
Print debug information to stderr
February 2025 wasm-merge 122