Setting up the configuration for a Yew (Trunk): dev, prod.

Grzegorz Bylica
Feb 16, 2025

--

To develop a Yew locally and deploy it to a server, the configuration must accommodate different parameter values.

Decision table for solution selection.

In my opinion, the easiest solution is to use Bash scripts.

dev.sh

#!/bin/bash
trunk serve \
-- public-url "/" \
-- address "127.0.0.2"

If the configuration is already in the Trunk.toml file, the command-line parameters will overwrite it.

trunk build --release \
-- public-url "https://my_domain.test"

The example source code is available at:

Reading materials:

https://trunkrs.dev/configuration

https://yew.rs

https://trunkrs.dev

Thank you! 😊

--

--

Grzegorz Bylica
Grzegorz Bylica

Written by Grzegorz Bylica

I work with different technologies, but programming in Rust is especially fun. Connect with me on LinkedIn https://www.linkedin.com/in/grzegorz-bylica

No responses yet