diff --git a/packages/nx/src/daemon/server/file-watching/file-watcher-sockets.ts b/packages/nx/src/daemon/server/file-watching/file-watcher-sockets.ts index 85d38ef560b5ad..35d25ace50161a 100644 --- a/packages/nx/src/daemon/server/file-watching/file-watcher-sockets.ts +++ b/packages/nx/src/daemon/server/file-watching/file-watcher-sockets.ts @@ -1,4 +1,5 @@ import { Socket } from 'net'; +import { findMatchingProjects } from '../../../utils/find-matching-projects'; import { ProjectGraph } from '../../../config/project-graph'; import { findAllProjectNodeDependencies } from '../../../utils/project-graph-utils'; import { PromisedBasedQueue } from '../../../utils/promised-based-queue'; @@ -55,7 +56,12 @@ export function notifyFileWatcherSockets( changedFiles.push(...projectFiles); } } else { - const watchedProjects = new Set(config.watchProjects); + const watchedProjects = new Set( + findMatchingProjects( + config.watchProjects, + currentProjectGraphCache.nodes + ) + ); if (config.includeDependentProjects) { for (const project of config.watchProjects) {