diff --git a/packages/nx/src/project-graph/project-graph.ts b/packages/nx/src/project-graph/project-graph.ts index eb1c101faee7b2..06fce0155621c5 100644 --- a/packages/nx/src/project-graph/project-graph.ts +++ b/packages/nx/src/project-graph/project-graph.ts @@ -237,6 +237,13 @@ export async function createProjectGraphAsync( resetDaemonClient: false, } ): Promise { + if (process.env.NX_FORCE_REUSE_CACHED_GRAPH === 'true') { + try { + return readCachedProjectGraph(); + // If no cached graph is found, we will fall through to the normal flow + } catch {} + } + const projectGraphAndSourceMaps = await createProjectGraphAndSourceMapsAsync( opts );