+ # 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