diff --git a/packages/nx/src/plugins/js/project-graph/build-dependencies/build-dependencies.ts b/packages/nx/src/plugins/js/project-graph/build-dependencies/build-dependencies.ts index 6913c31bd9749..65be83e3fa5b9 100644 --- a/packages/nx/src/plugins/js/project-graph/build-dependencies/build-dependencies.ts +++ b/packages/nx/src/plugins/js/project-graph/build-dependencies/build-dependencies.ts @@ -17,6 +17,7 @@ export function buildExplicitDependencies( builder: ProjectGraphBuilder ) { let totalNumOfFilesToProcess = totalNumberOfFilesToProcess(ctx); + if (totalNumOfFilesToProcess === 0) return; // using workers has an overhead, so we only do it when the number of // files we need to process is >= 100 and there are more than 2 CPUs // to be able to use at least 2 workers (1 worker per CPU and