fix(tasks): update styles watcher to support chokidar v4#141
Conversation
|
Issues Found
|
|
Thanks for reviewing! changes made:
The glob import was already present on line 2, so nothing to add there. |
| absolute: true | ||
| }); | ||
|
|
||
| const watcher = chokidar.watch(files, { |
There was a problem hiding this comment.
Instead of creating a huge static list of paths with glob why not use something like this which translates to the previous behavior?
chokidar.watch(config.general.sourcesPath, {
ignored: (filePath, stats) => stats?.isFile() && !filePath.endsWith(`.${config.general.sourceKey}.scss`),
ignoreInitial: true
});
There was a problem hiding this comment.
I saw the issue description after I left my comment. The why of the solution I think should be clearly stated also in the PR description in addition to the link to the issue.
The current proposal could seem to be the only alternative with chokidar.
easingthemes
left a comment
There was a problem hiding this comment.
Approving — the async/await refactor is a real improvement and the fast-glob → array approach is the right shape for chokidar's post-v3 contract. Reuse of fast-glob (already used in utils/generateEntries.js) keeps the codebase consistent, and the inline comment about the new-file watcher limitation is the right call.
Left a few inline questions/suggestions — only the chokidar v5→v4 rationale (in package.json) is something I'd like clarified before merge; the rest are nice-to-haves or follow-ups.
Hugoer
left a comment
There was a problem hiding this comment.
@easingthemes ready to re-check
This PR fixes an issue with SCSS file watchers caused by Chokidar version > 3. In versions 4+, Chokidar no longer supports glob patterns directly.
Description
Chokidar v4 removed support for glob patterns in
watch().This PR updates the styles watcher to handle that breaking change by pre-resolving SCSS files via
fast-globbefore passing them to chokidar.Related Issue
Fixes #138
Types of changes
Checklist: