Skip to content

Commit 78f92f7

Browse files
fix: keep the retained hot update directory after a failed clean
1 parent e8804e8 commit 78f92f7

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

‎lib/output/CleanPlugin.js‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -454,6 +454,12 @@ class CleanPlugin {
454454
}
455455
}
456456

457+
// the retained set counts as emitted, so neither it nor its directory
458+
// is removed; with timestamp 0 it goes once a newer set replaces it
459+
for (const asset of lastHotUpdateAssets) {
460+
if (!currentAssets.has(asset)) currentAssets.set(asset, 0);
461+
}
462+
457463
const outputPath = compilation.getPath(compiler.outputPath, {});
458464

459465
/**
@@ -479,7 +485,6 @@ class CleanPlugin {
479485
return;
480486
}
481487
const removed = /** @type {Diff} */ (diff);
482-
for (const asset of lastHotUpdateAssets) removed.delete(asset);
483488
applyDiff(
484489
fs,
485490
outputPath,

0 commit comments

Comments
 (0)