silverfin / silverfin-cli

Command line tool for Silverfin template development
4 stars 1 forks source link

fix: rework watch functions to avoid infinite updates in development-mode #116

Closed Woetfin closed 6 months ago

Woetfin commented 7 months ago

Description

On macOS, the fs.watch can be unstable and we use this to run development-mode.

In some cases, a "change" event in one file, was triggering change events for ALL files.

Reworked to use chokidar instead, which is built to support the same watch use-cases for fs.watch, but make its behaviour more stable cross-platform + it also simplifies the logic in these functions.

Fixes # (link to the corresponding issue if applicable)

Type of change

Checklist