Skip to content

Commit bdd69f3

Browse files
committed
fix: add condition to bypass cache operations when NX_CACHE_PROJECT_GRAPH is false
1 parent 14c2216 commit bdd69f3

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

nx-node-sea/src/plugin.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,9 @@ function getCachePath(options: NodeSeaPluginOptions) {
5555
function readTargetsCache(
5656
cachePath: string
5757
): Record<string, Record<string, TargetConfiguration>> {
58+
if (process.env.NX_CACHE_PROJECT_GRAPH === 'false') {
59+
return {};
60+
}
5861
if (existsSync(cachePath)) {
5962
return readJsonFile(cachePath);
6063
}
@@ -65,6 +68,9 @@ function writeTargetsToCache(
6568
cachePath: string,
6669
targets: Record<string, Record<string, TargetConfiguration>>
6770
) {
71+
if (process.env.NX_CACHE_PROJECT_GRAPH === 'false') {
72+
return;
73+
}
6874
writeJsonFile(cachePath, targets);
6975
}
7076

0 commit comments

Comments
 (0)