air-verse / air

☁️ Live reload for Go apps
GNU General Public License v3.0
17.39k stars 796 forks source link

Run a passive command? #633

Open senpro-ingwersenk opened 4 weeks ago

senpro-ingwersenk commented 4 weeks ago

Hello!

Really simple: I am building a small frontend and bundle it with Vite. The generated HTML file is consumed with go:embed - and I would like to use Air to put the pieces together nicely.

It seems that the pre_cmd is blocking, so running vite's watcher halts the whole thing unfortunately.

Got another idea?

Kind regards!

rweir commented 1 week ago

does vite not have a way to process files and exit? that's what I do for Go's templ:

cmd = "templ generate && go build -o ./tmp/web ./cmd/web/"