air-verse / air

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

Run a passive command? #633

Open senpro-ingwersenk opened 3 months ago

senpro-ingwersenk commented 3 months 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 2 months 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/"