Skip to content

Commit

Permalink
fix(utils): export map cache is tainted by unreliable parse results
Browse files Browse the repository at this point in the history
  • Loading branch information
G-Rath committed Sep 15, 2024
1 parent d145ac8 commit 55c12f6
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/exportMap/builder.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,11 @@ export default class ExportMapBuilder {

exportMap.mtime = stats.mtime;

exportCache.set(cacheKey, exportMap);
// If the visitor keys were not populated, then we shouldn't save anything to the cache,
// since the parse results may not be reliable.
if (exportMap.visitorKeys) {
exportCache.set(cacheKey, exportMap);

Check warning on line 98 in src/exportMap/builder.js

View check run for this annotation

Codecov / codecov/patch

src/exportMap/builder.js#L97-L98

Added lines #L97 - L98 were not covered by tests
}
return exportMap;
}

Expand Down

0 comments on commit 55c12f6

Please sign in to comment.