Build Command
The build
command compiles your Balius project into a WebAssembly component that can be executed by the Balius runtime.
Usage
cargo balius build
Process
The build
command performs the following steps:
- Executes
cargo build
with thewasm32-unknown-unknown
target - Converts the generated
.wasm
file into a WebAssembly component usingwasm-tools
What It Does
This command:
- Compiles your project to WebAssembly targeting
wasm32-unknown-unknown
- Locates the built
.wasm
file in your target directory - Uses
wasm-tools
to convert it into a component WebAssembly file with the name format{package_name}-c.wasm
Requirements
- WebAssembly target support in your Rust toolchain (install with
rustup target add wasm32-unknown-unknown
) - The
wasm-tools
command-line utility must be installed in your path
Build Outputs
After running the build command, you'll find:
- A standard WebAssembly file at
./target/wasm32-unknown-unknown/debug/{package_name}.wasm
- A component WebAssembly file at
./{package_name}-c.wasm
in your project root directory
Next Steps
After building your project:
- Test it with
cargo balius test
- Deploy your WebAssembly component to a Balius runtime