[fs-watcher] ignore node_modules on windows

Signed-off-by: Luke Page <137174537+lukpsaxo@users.noreply.github.com>
This commit is contained in:
Luke Page 2024-06-17 20:08:17 +02:00 committed by GitHub
parent a002572dd2
commit b0800b8884
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -16,7 +16,6 @@
import { chokidar } from './utilsBundle';
import type { FSWatcher } from 'chokidar';
import path from 'path';
export type FSEvent = { event: 'add' | 'addDir' | 'change' | 'unlink' | 'unlinkDir', file: string };
@ -52,7 +51,7 @@ export class Watcher {
if (!this._watchedFiles.length)
return;
const ignored = [...this._ignoredFolders, (name: string) => name.includes(path.sep + 'node_modules' + path.sep)];
const ignored = [...this._ignoredFolders, '**/node_modules/**'];
this._fsWatcher = chokidar.watch(watchedFiles, { ignoreInitial: true, ignored }).on('all', async (event, file) => {
if (this._throttleTimer)
clearTimeout(this._throttleTimer);