We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 25a7982 commit b63fbd9Copy full SHA for b63fbd9
1 file changed
packages/knip/src/util/file-entry-cache.ts
@@ -112,15 +112,20 @@ export class FileEntryCache<T> {
112
}
113
114
reconcile() {
115
- this.removeNotFoundFiles();
116
-
117
for (const [entryName, cacheEntry] of this.normalizedEntries) {
118
try {
119
- const meta = this._getMetaForFileUsingMtimeAndSize(cacheEntry);
+ const stat = fs.statSync(entryName);
+ const meta = Object.assign(cacheEntry.meta ?? {}, {
+ size: stat.size,
120
+ mtime: stat.mtime.getTime(),
121
+ });
122
this.cache.set(entryName, meta);
123
} catch (error) {
124
// @ts-expect-error
- if (error.code !== 'ENOENT') throw error;
125
+ if (error.code === 'ENOENT') {
126
+ this.normalizedEntries.delete(entryName);
127
+ this.cache.delete(entryName);
128
+ } else throw error;
129
130
131
0 commit comments