diff --git a/packages/workspace/src/tasks-runner/run-command.ts b/packages/workspace/src/tasks-runner/run-command.ts index 6c893af477695..2d046167c4d35 100644 --- a/packages/workspace/src/tasks-runner/run-command.ts +++ b/packages/workspace/src/tasks-runner/run-command.ts @@ -3,6 +3,7 @@ import { join } from 'path'; import { appRootPath } from 'nx/src/utils/app-root'; import type { NxJsonConfiguration, + ProjectConfiguration, ProjectGraph, ProjectGraphProjectNode, TargetDependencyConfig, @@ -347,7 +348,7 @@ export function createTask({ } function addTasksForProjectDependencyConfig( - project: ProjectGraphProjectNode, + project: ProjectGraphProjectNode, { target, configuration, @@ -428,7 +429,7 @@ function addTasksForProjectDependencyConfig( } } } - } else { + } else if (projectHasTarget(project, dependencyConfig.target)) { addTasksForProjectTarget( { project,