npm / webpack-dev-server
webpack-dev-server
What changed in webpack-dev-server 5 to 6, from its official release notes, upgrade guides and advisories. Also covers @types/webpack-dev-server. Sources checked 2026-10-18.
13 breaking7 security2 new APIs and options3 behavior and defaults2 tooling6 fixes and other
See which of these apply to your code, ranked, in your agent:
npx @unstale/cli initwebpack-dev-server 619 changes
Breaking changes 13
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.
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.
New APIs and options 1
The package exports native ESM from lib/ and a transpiled CommonJS build from dist/, allowing consumption from both module systems.
Behavior and default changes 3
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 1
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 1
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.