Chaining Tasks and using --watch
Is there a way to chain Deno tasks or something to that accord? I'd like to run esbuild from the command line to bundle/transpile some client JS and then have Deno start my dev webserver in watch mode. So each time a file is touched it runs esbuild and then Deno again.
7 Replies
You could try out pup with the watch functionality and a chained command (never try chaining commands in pup, open an issue if it doesn't work)
https://github.com/Hexagon/pup/blob/main/docs/examples/watcher/pup.jsonc
Manual at https://hexagon.github.io/pup
Config should be something like this
This looks interesting. I will check it out - thanks
I was hoping there would be a more straight forward Deno way to do this though...
Pup ^
It could be done with a one liner too (if it works at all right now), check out the "single command usage" section of https://hexagon.github.io/pup/usage.html#single-command-usage
If you want to avoid installing, you can run pup directly from the deno.land url and put everything in a deno task "deno task up", which would make it very slim
Nope, chaining does not work using a single process in pup. Will have to work on that
All good. I ended up compiling esbuild and calling it when initialising the app with Deno.run. I will come back and look at pup when the project goes into production. Thank you for your help
š
I have a dev server that might interest you.
https://github.com/nhrones/HotServe
Added preact jsx to HotServe example