Skip to content

Commit

Permalink
fix timestamps
Browse files Browse the repository at this point in the history
  • Loading branch information
vankop committed Feb 28, 2022
1 parent 1485eb5 commit 8f4807d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/CleanPlugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ const applyDiff = (fs, outputPath, dry, logger, diff, isKept, callback) => {
switch (type) {
case "check":
if (isKept(filename)) {
keptAssets.set(filename, Date.now());
keptAssets.set(filename, 0);
// do not decrement parent entry as we don't want to delete the parent
log(`${filename} will be kept`);
return process.nextTick(callback);
Expand Down Expand Up @@ -365,7 +365,7 @@ class CleanPlugin {
if (assetInfo && assetInfo.hotModuleReplacement) {
currentAssets.set(normalizedAsset, now + _10sec);
} else {
currentAssets.set(normalizedAsset, now);
currentAssets.set(normalizedAsset, 0);
}
}

Expand Down Expand Up @@ -394,13 +394,13 @@ class CleanPlugin {
logger,
diff,
isKept,
(err, notDeletedAssets) => {
(err, keptAssets) => {
if (err) {
oldAssets = undefined;
} else {
if (oldAssets) mergeAssets(currentAssets, oldAssets);
oldAssets = currentAssets;
if (notDeletedAssets) mergeAssets(oldAssets, notDeletedAssets);
if (keptAssets) mergeAssets(oldAssets, keptAssets);
}
callback(err);
}
Expand Down

0 comments on commit 8f4807d

Please sign in to comment.