Repository navigation
feat: run as a plugin from the top-level plugins of a multi-configuration - #5765
alexander-akait wants to merge 4 commits into
Conversation
🦋 Changeset detectedLatest commit: 662404d The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
WalkthroughServer.apply now registers shutdown on the compiler when its shutdown hook is available. Otherwise, it registers on child compilers. Documentation and tests cover using a top-level Server plugin to serve multiple configurations, including older webpack versions without the MultiCompiler shutdown hook. Priority: ⬇️ Low Merge Risk: ⚪ Minimal · up to
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #5765 +/- ##
=======================================
Coverage 95.15% 95.16%
=======================================
Files 6 6
Lines 4976 4982 +6
=======================================
+ Hits 4735 4741 +6
Misses 241 241 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
5.112.0 applies a multi-configuration's top-level `plugins` to the MultiCompiler (webpack/webpack#22702), so the test serving both configurations from there runs instead of being skipped. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UjuMAuk9o6UazjHzcAQCTA
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UjuMAuk9o6UazjHzcAQCTA
Summary
webpack/webpack#22702 lets a multi-configuration list
pluginsnext toparallelism; webpack applies them once to theMultiCompiler. With the dev server there, one server serves every configuration:apply()already handled aMultiCompiler, so this needs no new code path. It now tapsMultiCompiler.hooks.shutdownwhere webpack has it (5.110.0+) and keeps looping over the child compilers on older webpack. The peer range stays^5.101.0and webpack is not bumped; the fallback carries a TODO to remove it in the next major.webpack 5.112.0 ships #22702, and the lockfile is updated to it, so CI runs the top-level
pluginstest instead of skipping it. MultiCompiler plugin tests:pluginsunsupported)The branch is merged with
main, including #5750 (dev-middleware 8.4.0 client).The webpack-cli side (keeping these options under
--config-nameandextends) is webpack/webpack-cli#4871.What kind of change does this PR introduce?
feat
Did you add tests for your changes?
Yes, in
test/e2e/api-plugin.test.js:plugins, with setup, listen and stop each called once. It is skipped on webpack older than 5.112.0 (feature-detected, with a TODO to drop the check in the next major).MultiCompilerwithouthooks.shutdown, covering the fallback for webpack older than 5.110.0.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?
Added "Multiple configurations" to
examples/api/plugin/README.md. The webpack.js.org dev-server page could mention it now that webpack 5.112.0 supports top-levelplugins.Use of AI
Written with Claude Code: it made the change and the tests, and ran them against both the released webpack and webpack with #22702, directed and reviewed by the author.
🤖 Generated with Claude Code
https://claude.ai/code/session_01ML8tLtqrJohECUzhdBwqsw
Generated by Claude Code
Summary by CodeRabbit
Generated by Claude Code