a-h / templ

A language for writing HTML user interfaces in Go.
https://templ.guide/
MIT License
8.04k stars 264 forks source link

Improved dev flow #849

Closed martinmunillas closed 1 month ago

martinmunillas commented 2 months ago

As of right now I see myself using the following Makefile

include .env
export

templ:
    templ generate --watch --proxy="http://localhost:8020" -v

server:
    wgo run ./cmd

dev:
    make -j2 templ server

so I'm able to have auto reload on changes by doing make dev, it would be ideal if this could be baked altogether with in a templ run command or something. It would also be ideal if there could be a flag to attach a delve debugger to it and debug from the editor.

I would be more than willing to help doing these changes with some directions

a-h commented 1 month ago

I think you might be asking for templ generate --watch to re-run the cmd if Go files change. We want to do this, see https://github.com/a-h/templ/issues/646

a-h commented 1 month ago

I'll close this as a duplicate, since no extra info was received.