From f8ef99a6d72c48537b8ca97b962692ff264b637a Mon Sep 17 00:00:00 2001 From: Craigory Coppola Date: Mon, 10 Apr 2023 17:44:44 -0400 Subject: [PATCH] fix(core): deleted projects should not be in cached graph --- packages/nx/src/project-graph/build-project-graph.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/nx/src/project-graph/build-project-graph.ts b/packages/nx/src/project-graph/build-project-graph.ts index 35157faca1432..fa61c5e2ab442 100644 --- a/packages/nx/src/project-graph/build-project-graph.ts +++ b/packages/nx/src/project-graph/build-project-graph.ts @@ -74,7 +74,7 @@ export async function buildProjectGraphUsingProjectFileMap( let filesToProcess; let cachedFileData; - if ( + const useCacheData = cache && !shouldRecomputeWholeGraph( cache, @@ -82,8 +82,8 @@ export async function buildProjectGraphUsingProjectFileMap( projectsConfigurations, nxJson, rootTsConfig - ) - ) { + ); + if (useCacheData) { const fromCache = extractCachedFileData(projectFileMap, cache); filesToProcess = fromCache.filesToProcess; cachedFileData = fromCache.cachedFileData; @@ -103,7 +103,7 @@ export async function buildProjectGraphUsingProjectFileMap( context, cachedFileData, projectGraphVersion, - cache + useCacheData ? cache : null ); const projectGraphCache = createCache( nxJson,