[fs-watcher] ignore node_modules on windows
Signed-off-by: Luke Page <137174537+lukpsaxo@users.noreply.github.com>
This commit is contained in:
parent
a002572dd2
commit
b0800b8884
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Reference in a new issue