Skip to content

Commit 0b49c69

Browse files
committed
Add config file to cache (#1156)
1 parent aaa1bd0 commit 0b49c69

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

packages/knip/src/WorkspaceWorker.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ type WorkspaceManagerOptions = {
5656
configFilesMap: Map<string, Map<PluginName, Set<string>>>;
5757
};
5858

59-
type CacheItem = { resolveConfig?: Input[]; resolveFromAST?: Input[] };
59+
type CacheItem = { resolveConfig?: Input[]; resolveFromAST?: Input[]; configFile?: Input };
6060

6161
const nullConfig: EnsuredPluginConfiguration = { config: null, entry: null, project: null };
6262

@@ -364,6 +364,7 @@ export class WorkspaceWorker {
364364
const data = fd.meta.data;
365365
if (data.resolveConfig) for (const id of data.resolveConfig) addInput(id, configFilePath);
366366
if (data.resolveFromAST) for (const id of data.resolveFromAST) addInput(id, configFilePath);
367+
if (data.configFile) addInput(data.configFile);
367368
continue;
368369
}
369370

@@ -410,6 +411,7 @@ export class WorkspaceWorker {
410411
if (basename(configFilePath) !== 'package.json') {
411412
addInput(toEntry(configFilePath));
412413
addInput(toConfig(pluginName, configFilePath));
414+
cache.configFile = toEntry(configFilePath);
413415

414416
if (!seen.has(key)) seen.set(key, new Set());
415417
seen.get(key)?.add(configFilePath);

0 commit comments

Comments
 (0)