()
| 7 | * Tries to read from cache first, falls back to async creation. |
| 8 | */ |
| 9 | export async function loadNxProjectGraph(): Promise<ProjectGraph> { |
| 10 | const { readCachedProjectGraph, createProjectGraphAsync } = await import( |
| 11 | '@nx/devkit' |
| 12 | ); |
| 13 | try { |
| 14 | return readCachedProjectGraph(); |
| 15 | } catch (error) { |
| 16 | logger.warn( |
| 17 | `Could not read cached project graph, falling back to async creation.\n${stringifyError(error)}`, |
| 18 | ); |
| 19 | return createProjectGraphAsync({ exitOnError: false }); |
| 20 | } |
| 21 | } |
no test coverage detected