GeezerVison is showing github.com — fix(clean): keep the last hot update outside output.path and files it cannot remove by alexander-akait · Pull Request #23507 · webpack/webpack
Conversation
alexander-akait
commented
Nov 21, 2026
•
edited by coderabbitai
Bot
Loading
Uh oh!
There was an error while loading. Please reload this page.
Summary
Two follow-ups to #23504 for files output.clean removes outside of output.path.
1. The last hot update outside of output.path
output: {
clean: true,
allowOutside: ["/app/hmr"],
hotUpdateChunkFilename: "../hmr/[id].[fullhash].hot-update.js"
}
| Rebuild |
Before |
After |
| emits no new hot update |
the last one is removed, a client still fetching it fails |
the last one stays |
| emits a newer one |
the old one is removed |
the old one is removed |
Inside output.path, clean already keeps the last hot update until a newer one is emitted. Outside it, the file was treated as an ordinary stale file. It is now kept the same way.
2. A file clean cannot remove
What kind of change does this PR introduce?
fix
Did you add tests for your changes?
Yes, test/watchCases/clean/allow-outside-hot-update: step 0 writes a hot update outside, step 1 writes none (it must stay), step 2 writes a newer one (the old one must go). It fails without the fix. The unlink case has no test, as it needs an output file system without unlink.
Does this PR introduce a breaking change?
No.
If relevant, what needs to be documented once your changes are merged or what have you already documented?
n/a
Use of AI
Claude Code wrote the fix and the test from review findings on #23504 and ran the test suites; I reviewed it.
Generated by Claude Code
Generated by Claude Code
Summary by CodeRabbit
- Bug Fixes
- Fixed cleanup behavior for hot-update files stored outside the output directory. The latest update now remains available across watch builds until a newer update replaces it, including when the output filesystem cannot remove files. Once replaced, older updates can be cleaned up so the current update remains available.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
Reports for f4f0973, computed by this pull request's own code. Each section updates when its workflow finishes.
Preview package
This PR is packaged and the instant preview of its latest commit is available.
Install it locally:
npm i -D webpack@https://pkg.pr.new/webpack@23507
yarn add -D webpack@https://pkg.pr.new/webpack@23507
pnpm add -D webpack@https://pkg.pr.new/webpack@23507
From Preview package run #13849.
Generated code size
Comparing base (badc7b3) to head (f4f0973). Merging this pull request adds 46 new asset(s).
| What moved |
Tests |
Assets |
Gzip |
Raw |
Test edit |
| Changed, test untouched |
0 |
0 |
— |
— |
— |
| Changed, test edited |
0 |
0 |
— |
— |
— |
| New |
3 |
46 |
⚪ added +25.07 KiB |
⚪ added +64.91 KiB |
— |
| Deleted |
0 |
0 |
— |
— |
— |
| Unchanged |
— |
10891 |
— |
— |
— |
Read Changed, test untouched first: the test is byte-identical on both sides, so webpack generated the difference. Changed, test edited moved partly because the test did — Test edit is how many bytes the test gained, and a bundle that grew by less is not a regression. New and Deleted are whole files, not deltas — a new asset was created, not grown, so it reads gray (⚪ added) — and adding tests cannot bury a real change. Gzip decides, because that is what users download; raw is the tiebreak, and brotli and zstd are per asset below.
Sample apps
No sample app changed size.
26 unchanged app(s)
| App |
Gzip |
Gzip change |
Raw |
Raw change |
library amd |
1.38 KiB |
— |
2.68 KiB |
— |
library amd-require |
1.38 KiB |
— |
2.67 KiB |
— |
library assign |
1.38 KiB |
— |
2.66 KiB |
— |
library assign-properties |
1.42 KiB |
— |
2.80 KiB |
— |
library commonjs |
1.38 KiB |
— |
2.66 KiB |
— |
library commonjs-module |
1.38 KiB |
— |
2.67 KiB |
— |
library commonjs-static |
1.55 KiB |
— |
3.54 KiB |
— |
library commonjs2 |
1.38 KiB |
— |
2.67 KiB |
— |
library global |
1.38 KiB |
— |
2.66 KiB |
— |
library jsonp |
1.37 KiB |
— |
2.66 KiB |
— |
library module |
1.21 KiB |
— |
2.35 KiB |
— |
library self |
1.38 KiB |
— |
2.66 KiB |
— |
library system |
1.41 KiB |
— |
2.73 KiB |
— |
library this |
1.37 KiB |
— |
2.66 KiB |
— |
library umd |
1.44 KiB |
— |
2.85 KiB |
— |
library umd2 |
1.44 KiB |
— |
2.85 KiB |
— |
library var |
1.38 KiB |
— |
2.67 KiB |
— |
library window |
1.38 KiB |
— |
2.66 KiB |
— |
node-ssr |
96.36 KiB |
— |
371.26 KiB |
— |
node-ssr-esm |
96.60 KiB |
— |
371.83 KiB |
— |
react-100 |
32.14 KiB |
— |
150.41 KiB |
— |
react-1k |
73.31 KiB |
— |
907.23 KiB |
— |
react-1k-esm |
72.51 KiB |
— |
906.05 KiB |
— |
react-5k |
191.45 KiB |
— |
4.08 MiB |
— |
webworker |
36.60 KiB |
— |
94.98 KiB |
— |
webworker-esm |
35.67 KiB |
— |
93.65 KiB |
— |
No asset that both runs emit changed size — everything below is new or deleted.
46 asset(s) this pull request adds, biggest 20 by raw size
|
Asset |
Raw |
Gzip (9) |
Brotli (11) |
Zstd (19) |
| ⚪ added |
output/outside-routes-allowed ../routes-out/bundle0.js.map |
19.50 KiB |
6.24 KiB |
5.49 KiB |
6.03 KiB |
| ⚪ added |
output/outside-routes-unset ../routes-out/bundle0.js.map |
19.50 KiB |
6.24 KiB |
5.49 KiB |
6.03 KiB |
| ⚪ added |
output/outside-routes-future-defaults ../routes-out/bundle0.mjs.map |
12.13 KiB |
4.13 KiB |
3.65 KiB |
4.00 KiB |
| ⚪ added |
output/outside-routes-allowed bundle0.js |
3.84 KiB |
1.82 KiB |
1.57 KiB |
1.80 KiB |
| ⚪ added |
output/outside-routes-unset bundle0.js |
3.84 KiB |
1.82 KiB |
1.57 KiB |
1.80 KiB |
| ⚪ added |
output/outside-routes-future-defaults bundle0.mjs |
2.70 KiB |
1.35 KiB |
1.18 KiB |
1.34 KiB |
| ⚪ added |
output/outside-routes-allowed ../routes-out/../routes-out/worker-447.js.map |
208 B |
167 B |
139 B |
155 B |
| ⚪ added |
output/outside-routes-unset ../routes-out/../routes-out/worker-447.js.map |
208 B |
167 B |
139 B |
155 B |
| ⚪ added |
output/outside-routes-future-defaults ../routes-out/../routes-out/worker-447.js.map |
190 B |
160 B |
150 B |
148 B |
| ⚪ added |
output/outside-routes-allowed ../routes-out/lazy.js |
183 B |
163 B |
147 B |
146 B |
| ⚪ added |
output/outside-routes-unset ../routes-out/lazy.js |
183 B |
163 B |
147 B |
146 B |
| ⚪ added |
output/outside-routes-allowed ../routes-out/../routes-out/lazy.js.map |
175 B |
149 B |
124 B |
141 B |
| ⚪ added |
output/outside-routes-unset ../routes-out/../routes-out/lazy.js.map |
175 B |
149 B |
124 B |
141 B |
| ⚪ added |
output/outside-routes-allowed ../routes-out/../routes-out/bundle0.css.map |
172 B |
150 B |
116 B |
140 B |
| ⚪ added |
output/outside-routes-allowed ../routes-out/../routes-out/css-466.css.map |
172 B |
152 B |
123 B |
140 B |
| ⚪ added |
output/outside-routes-future-defaults ../routes-out/../routes-out/bundle0.css.map |
172 B |
150 B |
116 B |
140 B |
| ⚪ added |
output/outside-routes-future-defaults ../routes-out/../routes-out/css-466.css.map |
172 B |
152 B |
123 B |
140 B |
| ⚪ added |
output/outside-routes-unset ../routes-out/../routes-out/bundle0.css.map |
172 B |
150 B |
116 B |
140 B |
| ⚪ added |
output/outside-routes-unset ../routes-out/../routes-out/css-466.css.map |
172 B |
152 B |
123 B |
140 B |
| ⚪ added |
output/outside-routes-future-defaults ../routes-out/lazy.js |
112 B |
115 B |
93 B |
106 B |
|
… 26 more, see the uploaded report |
|
|
|
|
No runtime that both runs build changed which runtime modules it carries.
3 runtime(s) this pull request adds or no longer builds
|
Runtime |
Modules |
| ➕ |
output/outside-routes-allowed bundle0 |
10 |
| ➕ |
output/outside-routes-unset bundle0 |
10 |
| ➕ |
output/outside-routes-future-defaults bundle0 |
6 |
Built test/configCases with the defaults a user gets, and the apps in test/sizeCoreReports (apps/): 2511 test(s), 10937 asset(s), 112 emitted nothing.
From Generated code size run #8484.
Types Coverage
Typed lines: 99.66% (206421 of 207134)
| Kind |
Base |
Head |
Change |
any |
41 |
41 |
— |
unknown |
18 |
18 |
— |
object |
18 |
15 |
🟢 −3 |
Function |
0 |
0 |
— |
| untyped |
0 |
0 |
— |
any counts EXPECTED_ANY, a written any and JSDoc's * and ? for any type. unknown counts a written unknown; ThrownValue, the unknown a throw or a rejected promise hands on, is left out. object counts EXPECTED_OBJECT and Object, Function counts EXPECTED_FUNCTION. Untyped counts the any TypeScript infers where no type is written: a type argument a call leaves to inference that comes out any, whether a lib signature defaults it, as in const map = new Map() and Array(5), or a generic call infers it from an any argument; and const list = []. An identifier that only holds an any written in the project's files is not counted again, as the any row counts it where it is written; an any a lib signature returns, such as JSON.parse's, is counted in neither row.
Changed by this pull request
| File |
Typed lines |
any |
unknown |
object |
Function |
untyped |
lib/javascript/syntax-printer.js |
99.99% |
|
|
2 (🟢 −3) |
|
|
What the files this pull request changes still have
lib/javascript/syntax-printer.js:153 object (EXPECTED_OBJECT)
lib/javascript/syntax-printer.js:206 object (EXPECTED_OBJECT)
33 file(s) in lib/, hot/, declarations/ and bin/ still have an escape hatch, `any` or untyped identifiers
| File |
Typed lines |
any |
unknown |
object |
Function |
untyped |
declarations/WebpackOptions.ts |
100.00% |
7 |
|
|
|
|
lib/Compilation.js |
99.97% |
5 |
2 |
|
|
|
lib/module/NormalModule.js |
100.00% |
4 |
1 |
|
|
|
lib/loaders/LoaderOptionsPlugin.js |
100.00% |
4 |
|
|
|
|
lib/serialization/ObjectMiddleware.js |
100.00% |
|
|
4 |
|
|
lib/util/SortableSet.js |
100.00% |
|
4 |
|
|
|
lib/hmr/HotModuleReplacement.runtime.js |
100.00% |
|
2 |
1 |
|
|
lib/module/NormalModuleFactory.js |
100.00% |
|
3 |
|
|
|
lib/stats/StatsFactory.js |
100.00% |
2 |
|
1 |
|
|
lib/Compiler.js |
100.00% |
2 |
|
|
|
|
lib/config/defineConfig.js |
100.00% |
2 |
|
|
|
|
lib/hmr/JavascriptHotModuleReplacement.runtime.js |
100.00% |
|
|
2 |
|
|
lib/index.js |
100.00% |
2 |
|
|
|
|
lib/javascript/syntax-printer.js |
99.99% |
|
|
2 (🟢 −3) |
|
|
lib/loaders/LoaderRunner.js |
100.00% |
2 |
|
|
|
|
lib/module/Module.js |
100.00% |
2 |
|
|
|
|
lib/module/Parser.js |
100.00% |
2 |
|
|
|
|
lib/node/nodeConsole.js |
100.00% |
|
2 |
|
|
|
lib/util/cleverMerge.js |
100.00% |
|
|
2 |
|
|
lib/config/cli.js |
100.00% |
1 |
|
|
|
|
lib/dll/DllReferencePlugin.js |
100.00% |
1 |
|
|
|
|
lib/graph/ModuleGraph.js |
100.00% |
1 |
|
|
|
|
lib/hmr/HotModuleReplacementPlugin.js |
100.00% |
|
1 |
|
|
|
lib/javascript/JavascriptParser.js |
100.00% |
|
|
1 |
|
|
lib/javascript/syntax-parser.js |
100.00% |
1 |
|
|
|
|
lib/logging/Logger.js |
100.00% |
1 |
|
|
|
|
lib/logging/createConsoleLogger.js |
100.00% |
|
1 |
|
|
|
lib/output/ManifestPlugin.js |
100.00% |
1 |
|
|
|
|
lib/serialization/types.js |
100.00% |
|
|
1 |
|
|
lib/stats/DefaultStatsFactoryPlugin.js |
100.00% |
|
1 |
|
|
|
lib/stats/StatsPrinter.js |
100.00% |
1 |
|
|
|
|
lib/util/makeSerializable.js |
100.00% |
|
|
1 |
|
|
lib/util/terminalColors.js |
100.00% |
|
1 |
|
|
|
From Types Coverage run #4520.
Module loading
How many files a fresh Node.js process loads (require or import) to do each thing below; a change from the pull request's base is marked 🔴 when it grew and 🟢 when it shrank. Every file is startup time, so fewer is better. webpack files are this package's own (lib/, hot/); node_modules files are its dependencies'.
| What the process does |
webpack files |
node_modules files |
require("webpack") |
2 |
0 |
import "webpack" |
2 |
0 |
| JavaScript syntax |
12 |
0 |
| CSS syntax |
12 |
0 |
| HTML syntax |
11 |
0 |
| XML syntax |
11 |
0 |
| JavaScript minifier |
13 |
0 |
| CSS minifier |
14 |
0 |
| HTML minifier |
19 |
0 |
| XML minifier |
14 |
0 |
| JSON minifier |
1 |
0 |
| development build |
422 |
103 |
| production build |
430 |
133 |
| watch with HMR, one rebuild |
446 |
110 |
From Module loading run #1764.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
coderabbitai
Bot
commented
Nov 21, 2026
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
|

No actionable comments were generated in the recent review.
Walkthrough
-
CleanPlugin now tracks outside-output hot-update files across emits, including when unlink is unavailable. Tests cover outside routes, chunk names, hot-update retention, and recovery after a failed write. The Test262 case timeout increases from 10 to 20 seconds.
Changes: Outside-output asset handling
| Layer / File(s) |
Summary |
Track outside hot updates lib/output/CleanPlugin.js, .changeset/296-clean-outside-hot-update.md |
CleanPlugin records outside-output hot-update paths and commits pending paths after emit. It retains prior paths when a compilation emits none and tracks files when the output filesystem does not support unlink. |
Test output routes outside output.path test/helpers/outsideRoutes.js, test/configCases/output/outside-routes-* |
The shared helper configures routes for allowed, unset, and futureDefaults modes. Test fixtures check output files and expected warnings or errors for multiple asset types. |
Test outside chunk names test/watchCases/clean/allow-outside-chunk-name/* |
Watch cases dynamically import chunks named outside output.path and check the emitted JavaScript and CSS files. |
Validate hot-update cleanup test/watchCases/clean/allow-outside-hot-update/* |
The watch case checks outside hot-update files and module values across rebuilds. |
Check outside hot-update write failure test/watchCases/clean/allow-outside-hot-update-write-failure/* |
The watch case checks that a prior hot-update file remains after an EISDIR error. It removes the failed-write path and invalidates the watcher to test recovery. |
Test262 timeout
| Layer / File(s) |
Summary |
Increase Test262 case timeout test/specCases/test262.spectest.js |
The timeout increases from 10,000 to 20,000 milliseconds. The comment describes per-case timeout failures and the Jest build timeout. |
Change: Bug fix
Merge Risk: Minimal · up to f4f09
-
This change keeps the latest outside-output hot update until a newer one is written. It also keeps files that cannot be unlinked tracked. Test coverage is added for the main flows, and no merge-blocking risk remains.
Pre-merge checks: 4
-
| Check name |
Status |
Explanation |
| Description Check |
 |
Check skipped - CodeRabbit’s high-level summary is enabled. |
| Title check |
 |
The title uses the conventional-commit form with type fix and scope clean. The branch prefix is not provided, so the match to the branch prefix cannot be checked. The subject matches the changes: the … |
| Linked Issues check |
 |
Check skipped because no linked issues were found for this pull request. |
| Out of Scope Changes check |
 |
Check skipped because no linked issues were found for this pull request. |
Full details: Title check
-
Explanation
The title uses the conventional-commit form with type fix and scope clean. The branch prefix is not provided, so the match to the branch prefix cannot be checked. The subject matches the changes: the last hot update outside output.path is kept, and files that cannot be unlinked are tracked as kept.
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Share
-
Recent review info
-
Run configuration
-
Commits
-
Reviewing files that changed from the base of the PR and between 8de6fe2 and f4f0973.
Files ignored due to path filters: 1
-
test/configCases/output/outside-routes-unset/img.png is excluded by !**/*.png
Files selected for processing: 21
-
test/configCases/output/outside-routes-allowed/webpack.config.js
test/configCases/output/outside-routes-future-defaults/errors.js
test/configCases/output/outside-routes-future-defaults/test.config.js
test/configCases/output/outside-routes-future-defaults/webpack.config.js
test/configCases/output/outside-routes-unset/copied.txt
test/configCases/output/outside-routes-unset/entry.js
test/configCases/output/outside-routes-unset/index.js
test/configCases/output/outside-routes-unset/lazy.css
test/configCases/output/outside-routes-unset/lazy.js
test/configCases/output/outside-routes-unset/page.html
test/configCases/output/outside-routes-unset/style.css
test/configCases/output/outside-routes-unset/warnings.js
test/configCases/output/outside-routes-unset/webpack.config.js
test/configCases/output/outside-routes-unset/worker.js
test/helpers/outsideRoutes.js
test/watchCases/clean/allow-outside-chunk-name/0/index.js
test/watchCases/clean/allow-outside-chunk-name/0/lazy.js
test/watchCases/clean/allow-outside-chunk-name/0/style.css
test/watchCases/clean/allow-outside-chunk-name/1/index.js
test/watchCases/clean/allow-outside-chunk-name/2/index.js
test/watchCases/clean/allow-outside-chunk-name/webpack.config.js
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 6 remain after this review.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
codspeed
Bot
commented
Nov 21, 2026
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
Merging this PR will degrade performance by 28.89%
2 warnings, 1 note
⚠️ 117 benchmarks are dominated by system calls
System calls cannot be simulated consistently and are left out of the measure. The reported value understates the real cost. Switch to the Walltime instrument to measure them.
Learn more about system calls
See affected benchmarks
⚠️ 1 benchmark with a significant change ran on different hardware
Its base and head results were measured on machines with a different CPU, core count or memory, so the change might not come from the code. Run base and head on the same runner type.
Learn more about Macro Runners
See affected benchmarks
ℹ️ 38 benchmarks have no flamegraph
The flamegraph wasn't generated: most of the time was spent in runtime internals, which would leave nothing useful to analyze.
See affected benchmarks
❌ 1 regressed benchmark
✅ 350 untouched benchmarks
Performance Changes
Tip Investigate this regression by commenting @codspeedbot fix this regression on this PR, or directly use the CodSpeed MCP with your agent.
Comparing fix/clean-outside-hot-update (f4f0973) with main (badc7b3)
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Milestone
No milestone
Development
Successfully merging this pull request may close these issues.
Uh oh!
There was an error while loading. Please reload this page.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
|