npm / webpack-dev-server
webpack-dev-server
What changed in webpack-dev-server 3 to 6, from its official release notes, upgrade guides and advisories. Also covers @types/webpack-dev-server. Sources checked 2026-11-30.
16 breaking9 security3 deprecations4 new APIs and options1 performance4 behavior and defaults5 tooling19 fixes and other
See which of these apply to your code, ranked, in your agent:
npx @unstale/cli initwebpack-dev-server 640 changes
Breaking changes 14
Client internal files are gone, although client/index.js, client/socket.js, and client/clients/WebSocketClient.js still resolve.
Validate Host and Origin headers and enforce same-origin checks for proxied WebSocket upgrades handled with ws: true, preventing cross-origin pages from connecting to proxied WebSocket services.
CLI flags are removed; use the webpack-cli serve command with a configuration file or the programmatic API instead.
Express is upgraded to v5, which includes breaking changes for developers using the server.
The dependency is updated to v4, including breaking changes for developers using its proxy configuration.
The static method is removed from Server; resolve the local IP yourself if needed.
Cross-site requests to the internal endpoint are rejected; requests must be same-origin, validated via Sec-Fetch-Site with an Origin/Host fallback.
Node.js versions below 22.15.0 are no longer supported.
Cross-site requests to the internal endpoint are rejected; requests must be same-origin, validated via Sec-Fetch-Site with an Origin/Host fallback.
The bypass option is removed from proxy configuration; use the http-proxy-middleware router or context options instead.
The method is now asynchronous and resolves to an object containing filename and extra stats and outputFileSystem fields.
The spdy dependency is removed; use the built-in node:http2 module via the server option for HTTP/2 support.
The required webpack peer dependency range changes from ^5.0.0 to ^5.101.0.
The option no longer accepts "sockjs"; use the default "ws" transport instead.
Security 2
Validate Host and HTTP/2 authority headers independently of Origin protocol exceptions, including when allowedHosts is "all".
Malformed open-editor URLs receive a controlled response, and their query is parsed without relying on the Host header.
Deprecations 3
getClientEntry() continues to work, including subclass overrides, but is deprecated.
getClientHotEntry() continues to work, including subclass overrides, but is deprecated.
sendMessage() continues to work, including subclass overrides, but is deprecated.
New APIs and options 3
Export BaseServer for use by developers.
Set the WebSocket transport to "sse" to use Server-Sent Events.
The package exports native ESM from lib/ and a transpiled CommonJS build from dist/, allowing consumption from both module systems.
Performance 1
Options are validated with a precompiled schema, cutting about 115ms from startup.
Behavior and default changes 4
Console wording, the overlay, and the progress indicator now come from webpack-dev-middleware.
The target environment is determined from compiler.platform rather than the resolved target string; universal targets are treated as web targets so the client runtime is injected.
The compression middleware is enabled for HTTP/2 connections.
The ignored option now supports glob string patterns via tinyglobby.
Tooling 3
The browser client, error overlay, and transports now come from webpack-dev-middleware; the package has no client code of its own. Existing option names and meanings remain unchanged.
Run the dev server as a plugin from the top-level plugins of a multi-configuration, serving every configuration from one server.
webpack-dev-server can be used as a webpack plugin, integrating with the compiler lifecycle and supporting MultiCompiler setups with independent plugin servers.
Fixes and other changes 10
Client progress modes are fixed.
Hot and live reload continue working after a cancelled "Leave site?" dialog.
Local IP lookup is fixed.
The overlay lifecycle is fixed.
The progress lifecycle is fixed.
The overlay remains visible for a runtime error thrown while the page is still loading.
Server startup error handling is fixed.
Socket URL credentials are fixed.
A universal build now runs in Node without the client throwing.
Loopback aliases 127.0.0.1, ::1, and localhost are treated as equivalent so the WebSocket client does not reject valid same-origin connections.
webpack-dev-server 514 changes
Security 7
The route checks Sec-Fetch-Site, falling back to an Origin/Host comparison when absent, to prevent cross-site pages from triggering a rebuild.
The route checks Sec-Fetch-Site, falling back to an Origin/Host comparison when absent, to prevent cross-site pages from opening a file in the editor.
webpack-dev-server vulnerable to cross-site request forgery via internal developer endpoints
webpack-dev-server vulnerable to denial of service via a malformed Host or Origin header
webpack-dev-server vulnerable to HMR WebSocket interception via permissive user proxies
Sets the Cross-Origin-Resource-Policy header to prevent source code theft over HTTP.
webpack-dev-server vulnerable to cross-origin source code exposure on non-HTTPS origins
New APIs and options 1
Adds cause to errorObject, preserving the underlying error cause.
Tooling 1
The overlay can now be dismissed with the ESC key.
Fixes and other changes 5
Malformed Host and Origin header values are handled gracefully when validating requests.
The Server constructor once again accepts undefined for options, defaulting it to {}, so an optional webpack config devServer field type-checks and works.
The dev server skips the HMR WebSocket path when forwarding upgrade requests to user-defined proxies, so custom proxy WebSocket upgrades are no longer intercepted.
Fixes compatibility with event target and universal target when using lazy compilation.
Fixes the progress indicator styles.
webpack-dev-server 43 changes
Tooling 1
Improves the HTTPS command-line output.
Fixes and other changes 2
Fixes initial reloading for lazy compilation.
Respects the protocol from the browser for manual setup.
webpack-dev-server 34 changes
Breaking changes 2
Node.js v4 is no longer supported; support is limited to v6 and later.
webpack v4 is supported; older webpack versions are no longer supported.
Fixes and other changes 2
DynamicEntryPlugin is now supported correctly.
The page reloads after a code error is fixed, when webpack-dev-server was started with that error.