Conversation
- add `--poll` / `-p` option for polling - add `--ignored` / `-i` option for ignoring specified paths - add some default options for watcher based on config used in `tailwindcss`
|
| watch(filesPattern, { persistent: false }) | ||
| .on("add", (path) => { | ||
| .option( | ||
| "-p, --poll", |
There was a problem hiding this comment.
are those -p and -i shortcuts matching the Tailwind CLI? Personally, I would not introduce those as we might add some other options in the future and they might be better suited for having those shortcuts (this feels especial;y true about -p)
| .on("add", (path) => { | ||
| .option( | ||
| "-p, --poll", | ||
| "Use polling instead of filesystem events when watching" |
There was a problem hiding this comment.
is there any specific reason to prefer this in certain situations?
| ignored, | ||
| usePolling: shouldPoll, | ||
| interval: shouldPoll ? pollInterval : undefined, | ||
| ignoreInitial: true, |
There was a problem hiding this comment.
this one has been added, right? could you elaborate on why you think it's needed? what kind of issues this can help us avoid?
| stabilityThreshold: 50, | ||
| pollInterval: pollInterval, | ||
| } | ||
| : false, |
There was a problem hiding this comment.
previously we were using true here at all times - any particular reason why this has been changed?
What
--poll/-poption for polling--ignored/-ioption for ignoring specified pathstailwindcssWhy
--polloptionIt was easy to add and maybe someone will need that
--ignoredoptionThis might be useful for big projects / monorepos. Someone might want to ignore
node_modulesdirectory. My case was slightly different. Due to unexpected behavior ofchokidarlib on Windows, I had to ignore some additional paths. Nevertheless, the case is still valid :)Additional options
This was copied from https://github.com/tailwindlabs/tailwindcss/blob/60a0ae20176604b9444f95b09cbb1f549702a143/src/cli.js#L846-L854. Since
tailwindis widely used, I assumed those settings might serve as nice defaults.Thank you for your time.