Repository navigation
Commit 04d3f13
committed
refactor: add dev servers as plugins and reuse the watch flow in
With plugin support, `webpack serve` adds dev servers to the loaded
configuration as plugins: to the configuration that defines `devServer`
with `--dev-server-per-compiler`, otherwise to the top-level `plugins` of
the multi configuration. Then it compiles like `webpack watch`, reusing
its stats output, so `--json` works too. The old flow for dev servers
without plugin support is kept unchanged in the `else` branch.
webpack before 5.112 doesn't apply `plugins` of multi configurations, so
they are applied to the multi compiler before watching starts. TODOs mark
both workarounds for removal in the next major release.
Dev servers in plugin mode select ports before any of them listens, so
the CLI still assigns distinct automatic ports and rejects duplicate
explicit ports, otherwise one of the servers fails with EADDRINUSE.
The automatic ports test now picks ports below the ephemeral range, which
outgoing connections on Windows could take, and stops on EADDRINUSE instead
of waiting for the test timeout.
Claude-Session: https://claude.ai/code/session_013FhutRFjuQemBzekJMYcqLwebpack serve
1 parent 9c33fbf commit 04d3f13
2 files changed
Lines changed: 261 additions & 230 deletions
0 commit comments