tailwindlabs / tailwindcss.com

The Tailwind CSS documentation website.
https://tailwindcss.com
3.25k stars 1.72k forks source link

Document the `--watch=always` flag on the CLI #1835

Open alilleybrinker opened 2 months ago

alilleybrinker commented 2 months ago

While trying to run the CLI as a subcommand within a project (running from Rust code), I encountered a challenge where the tailwindcss command would exit rather than watching and rebuilding, even with the -w/--watch flag. It turns out by default that if stdin is closed, tailwindcss will close too to avoid becoming a zombie process, and that you can turn off this behavior with the un-documented flag --watch=always. The code for this is here: https://github.com/tailwindlabs/tailwindcss/blob/next/packages/%40tailwindcss-cli/src/commands/build/index.ts#L218-L224

It would be nice if this flag were documented somewhere.