From a43a99bea5fa6d1f26d221b08ff38f0ec192fa48 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Milo=C5=A1=20Lajtman?= Date: Thu, 2 Mar 2023 23:30:12 +0100 Subject: [PATCH] fix(core): use globbing also for workspace file patterns without '*' (#11298) --- packages/nx/src/hasher/hasher.ts | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/packages/nx/src/hasher/hasher.ts b/packages/nx/src/hasher/hasher.ts index a8891b81b4..fdac41a1f0 100644 --- a/packages/nx/src/hasher/hasher.ts +++ b/packages/nx/src/hasher/hasher.ts @@ -459,20 +459,12 @@ class TaskHasher { if (!this.filesetHashes[mapKey]) { this.filesetHashes[mapKey] = new Promise(async (res) => { const parts = []; - if (fileset.indexOf('*') > -1) { - this.projectGraph.allWorkspaceFiles - .filter((f) => minimatch(f.file, withoutWorkspaceRoot)) - .forEach((f) => { - parts.push(f.hash); - }); - } else { - const matchingFile = this.projectGraph.allWorkspaceFiles.find( - (t) => t.file === withoutWorkspaceRoot - ); - if (matchingFile) { - parts.push(matchingFile.hash); - } - } + this.projectGraph.allWorkspaceFiles + .filter((f) => minimatch(f.file, withoutWorkspaceRoot)) + .forEach((f) => { + parts.push(f.hash); + }); + const value = this.hashing.hashArray(parts); res({ value,