Much better than manual process, and avoids having to redo live-reloading logic
PVUQYWZEPOUY4VAFP77EFHZ4I6DJ6XXEUT7PNMBUQUIRG54E2P4QC
# Trunk is used to live-reload the generated output
# This configuration specifies the following steps:
# 1. Serve the generated `target/dist/index.html`
# 2. Wait for a file in `src` to change
# 3. Execute `cargo run` to update the visualization
# 4. Live-reload the webpage automatically
[[hooks]]
stage = "pre_build"
command = "cargo"
command_arguments = ["run"]
[build]
# TODO: Trunk will not start if this file does not exist, so have to manually bootstrap:
# mkdir --parents target/dist/; cargo run
# Tracked at https://github.com/trunk-rs/trunk/issues/172
target = "target/dist/index.html"
dist = "target/dist"
[watch]
watch = ["src/"]
[serve]
open = true