fix: handle middleware teardown in plugin mode#5703
Conversation
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #5703 +/- ##
==========================================
+ Coverage 82.90% 89.38% +6.47%
==========================================
Files 13 13
Lines 6126 6169 +43
==========================================
+ Hits 5079 5514 +435
+ Misses 1047 655 -392 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
This PR fixes teardown behavior when webpack-dev-server is used in plugin mode (server.apply(compiler)), ensuring compiler.close() does not surface an error due to dev-middleware shutdown semantics in that mode.
Changes:
- Skip calling
webpack-dev-middleware’sclose()duringServer.stop()when running in plugin mode (this.isPlugin). - Add an e2e regression test that asserts
compiler.close()completes without returning an error in plugin mode.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
test/e2e/api-plugin.test.js |
Adds a regression test validating compiler.close() returns no error in plugin mode. |
lib/Server.js |
Avoids calling middleware.close() during teardown when Server is operating as a plugin (apply() mode). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…n compiler close
Summary
What kind of change does this PR introduce?
Did you add tests for your changes?
Does this PR introduce a breaking change?
If relevant, what needs to be documented once your changes are merged or what have you already documented?
Use of AI