Skip to content

Commit

Permalink
fix(core): provide a way to reuse cached graph in CI
Browse files Browse the repository at this point in the history
  • Loading branch information
AgentEnder committed Dec 2, 2024
1 parent 432d9d3 commit ac9072d
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions packages/nx/src/project-graph/project-graph.ts
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,13 @@ export async function createProjectGraphAsync(
resetDaemonClient: false,
}
): Promise<ProjectGraph> {
if (process.env.NX_FORCE_REUSE_CACHED_GRAPH) {
try {
return readCachedProjectGraph();
// If no cached graph is found, we will fall through to the normal flow
} catch {}
}

const projectGraphAndSourceMaps = await createProjectGraphAndSourceMapsAsync(
opts
);
Expand Down

0 comments on commit ac9072d

Please sign in to comment.