Skip to content

Commit fe7d7ac

Browse files
authored
fix(js): include referenced internal config files in plugin cache hash (#28536)
1 parent 890ef83 commit fe7d7ac

File tree

1 file changed

+13
-6
lines changed

1 file changed

+13
-6
lines changed

packages/js/src/plugins/typescript/plugin.ts

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -173,18 +173,25 @@ async function createNodesInternal(
173173
* - hashes of the content of the relevant files that can affect what's inferred by the plugin:
174174
* - current config file
175175
* - config files extended by the current config file (recursively up to the root config file)
176+
* - referenced config files that are internal to the owning Nx project of the current config file
176177
* - lock file
177178
* - hash of the plugin options
178179
* - current config file path
179180
*/
180-
const extendedConfigFiles = getExtendedConfigFiles(
181-
fullConfigPath,
182-
readCachedTsConfig(fullConfigPath)
181+
const tsConfig = readCachedTsConfig(fullConfigPath);
182+
const extendedConfigFiles = getExtendedConfigFiles(fullConfigPath, tsConfig);
183+
const internalReferencedFiles = resolveInternalProjectReferences(
184+
tsConfig,
185+
context.workspaceRoot,
186+
projectRoot
183187
);
184188
const nodeHash = hashArray([
185-
...[configFilePath, ...extendedConfigFiles.files, lockFileName].map(
186-
hashFile
187-
),
189+
...[
190+
configFilePath,
191+
...extendedConfigFiles.files,
192+
...Object.keys(internalReferencedFiles),
193+
lockFileName,
194+
].map(hashFile),
188195
hashObject(options),
189196
]);
190197
const cacheKey = `${nodeHash}_${configFilePath}`;

0 commit comments

Comments
 (0)