Skip to content

Commit

Permalink
perf: less IO when dest is not entity
Browse files Browse the repository at this point in the history
  • Loading branch information
JLHwung committed Jun 4, 2021
1 parent 44c8f16 commit f76e1aa
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion babel-worker.cjs
Expand Up @@ -6,7 +6,6 @@ const fancyLog = require("fancy-log");

function needCompile(src, dest) {
let destStat;
const srcStat = statSync(src);
try {
destStat = statSync(dest);
} catch (err) {
Expand All @@ -16,6 +15,7 @@ function needCompile(src, dest) {
throw err;
}
}
const srcStat = statSync(src);
return srcStat.mtimeMs > destStat.mtimeMs;
}

Expand Down

0 comments on commit f76e1aa

Please sign in to comment.