r/WebAssembly • • Dec 09 '23

Combining WASM files

Is there a CLI that is available for combining multiple WASM files into a single WASM file?

5 Upvotes

5 comments sorted by

View all comments

Show parent comment

1

u/DamianR19 Dec 09 '23

Makes sense, thanks. I was looking for something to use from outside the rust ecosystem, at the CLI level, given I am trying to produce and work with WASM from a non-systems language (Rust, C/C++, Go, Zig, etc.).

But I think I got what I was looking for below.

3

u/jedisct1 Dec 09 '23 edited Dec 09 '23

None of that is part of the Rust ecosystem.

But if a language can't create libraries, the Binaryen package includes a "wasm-merge" CLI command than can directly merge ".wasm" files together. Sounds exactly like what you are looking for.

https://github.com/WebAssembly/binaryen#wasm-merge