moonwave icon indicating copy to clipboard operation
moonwave copied to clipboard

Filewatcher watches node_modules and other directories it doesn't need to

Open Quenty opened this issue 6 months ago • 1 comments

Need to add this line to the dev.ts

chokidar
            .watch(projectDir, {
                ignored: (file) => (file.includes("node_modules") || file.includes(".git")),
                ignoreInitial: true,
            })

To have it ignore other modules that aren't needed to be watched, otherwise you can get an error like this

node:internal/fs/watchers:207
      const error = new UVException({
                    ^

Error: EMFILE: too many open files, watch
    at FSWatcher._handle.onchange (node:internal/fs/watchers:207:21)
Emitted 'error' event on FSWatcher instance at:

Quenty avatar Apr 07 '25 19:04 Quenty