# run templ generation in watch mode to detect all .templ files and 
# re-create _templ.txt files on change, then send reload event to browser. 
# Default url: http://localhost:7331
live/templ:
	templ generate --notify-proxy --proxybind="localhost" --proxyport="8080"

# run air to detect any go file changes to re-build and re-run the server.
live/server:
	templ generate --watch --proxy="http://localhost:8080" --cmd="go run ."

# run esbuild to generate the index.js bundle in watch mode.
live/rollup:
	npm --prefix ts run build:watch

# start all 5 watch processes in parallel.
live: 
	make -j5 live/rollup live/server
