Skip to content

Commit

Permalink
Merge pull request #24 from hhru/HH-131498
Browse files Browse the repository at this point in the history
HH-131498 Fix deleted file cache invalidation
  • Loading branch information
gooverdian committed Jun 24, 2021
2 parents 30a6c75 + cf1ab05 commit a459faa
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@hh.ru/babel-plugin-static-value-extractor",
"version": "0.9.2",
"version": "1.0.1",
"main": "lib/index.js",
"devDependencies": {
"@babel/cli": "^7.5.0",
Expand Down
4 changes: 2 additions & 2 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,9 @@ export const prepareCache = (opts) => {
const invalidFiles = [];
Object.keys(cachedFiles).forEach((filePath) => {
const { cachedMtime } = cachedFiles[filePath];
const { mtimeMs } = fs.statSync(path.join(basePath, filePath));
const fullPath = path.join(basePath, filePath);

if (cachedMtime !== mtimeMs) {
if (!fs.existsSync(fullPath) || cachedMtime !== fs.statSync(fullPath).mtimeMs) {
invalidFiles.push(filePath, ...cachedFiles[filePath].reverseImports);
}
});
Expand Down

0 comments on commit a459faa

Please sign in to comment.