Setting up the configuration for a Yew (Trunk): dev, prod.
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
Thank you! 😊