This is a tool to convert a Go application to a WebAssembly component. It takes the following as input:
- a WIT file or directory
- the name of a WIT world defined in the above file or directory
- the directory containing a Go module which targets said world
The output is a component which may be run using e.g. wasmtime.
Requires Go 1.25.5+
Add the following to your go.mod file and run go mod tidy:
tool github.com/bytecodealliance/componentize-go
In the same directory as your go.mod file, you can interact with the tool:
go tool componentize-go --helpAlternatively:
go install github.com/bytecodealliance/componentize-go@latestIt should be accessible via PATH:
componentize-go --helpYou can download a specific release from the release page.
- Rust toolchain - Latest version
cargo install --git https://github.com/bytecodealliance/componentize-goPlease reference the README.md and Makefile files in each of the directories in examples.