diff --git a/packages/playwright/src/fsWatcher.ts b/packages/playwright/src/fsWatcher.ts index c0d4e4d04e..a1c09c343d 100644 --- a/packages/playwright/src/fsWatcher.ts +++ b/packages/playwright/src/fsWatcher.ts @@ -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);