LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

trunk

Rust WebAssembly application bundler

TLDR

Build the project
$ trunk build
copy
Build for release with optimizations
$ trunk build --release
copy
Serve with hot reload
$ trunk serve
copy
Serve on a specific port and address
$ trunk serve --port [3000] --address [0.0.0.0]
copy
Serve with a backend proxy
$ trunk serve --proxy-backend=http://localhost:[9000]/api/
copy
Watch for changes and rebuild
$ trunk watch
copy
Clean build artifacts
$ trunk clean
copy

SYNOPSIS

trunk command [--release] [options]

DESCRIPTION

Trunk is a build tool for Rust WebAssembly applications that handles compilation, bundling, and serving. It compiles Rust code to WebAssembly, processes assets like CSS and JavaScript, and generates the HTML and JavaScript glue code needed to run WASM modules in the browser.The development server provides hot reloading, automatically rebuilding and refreshing the browser when source files change. Release builds apply optimizations including WASM size reduction for production deployment.Trunk integrates with wasm-bindgen for JavaScript interop and works with frameworks like Yew, Leptos, and Seed. Configuration is managed through a Trunk.toml file in the project root.

PARAMETERS

build

Build the project, compiling Rust to WASM and bundling assets.
serve
Start development server with hot reloading.
watch
Watch for file changes and rebuild automatically.
clean
Remove build artifacts (dist directory).
--release
Enable release optimizations including WASM size reduction.
--public-url URL
Public URL prefix for asset paths.
--port PORT
Port for the dev server (default: 8080).
--address ADDR
Address to bind the dev server to.
--proxy-backend URL
Proxy requests to a backend server. The URI path of the URL determines the proxy path.
--proxy-rewrite URI
Alternative URI on which to listen for proxy requests.

CONFIGURATION

Trunk.toml

Project configuration file specifying build options, proxy settings, and asset pipeline rules.

INSTALL

sudo dnf install trunk
copy
sudo pacman -S trunk
copy
sudo apk add trunk
copy
brew install trunk
copy
nix profile install nixpkgs#trunk
copy

CAVEATS

Rust/WASM specific. wasm-bindgen based. Trunk.toml config.

HISTORY

Trunk was created for building and bundling Rust WebAssembly applications.

SEE ALSO

wasm-pack(1), cargo(1)

Braincup
Open source brain training for math, memory and focus
Braincup mini-games
41 mini-games · Apache-2.0
No ads · No tracking
Play in browser
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid
276 stars
From the maker of Linux Command Library
Copied to clipboard
Braincup
Open source brain training for math, memory and focus. 41 mini-games, from mental arithmetic to Sudoku, N-Back and Solo Chess.
Apache-2.0 licensed · No ads · No tracking · No account
From the maker of Linux Command Library
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid