Releases: webpack/webpack-dev-middleware
Release list
v8.3.0
Minor Changes
-
Added a
hotoption that enables hot module replacement, replacing the need forwebpack-hot-middleware. Passhot: trueto enable with defaults, orhot: { path, heartbeat, progress, statsOptions }to customize. The client runtime is served by the middleware itself. (by @bjohansebas in #2370) -
Take the diagnostics a hot payload carries from the
statsoption, so one setting governs what a build reports in the terminal and in the browser:stats: "errors-only"keeps warnings out of both, andstats: falsekeeps errors and warnings out of both, the client's error overlay included — reach for the client's?logging=or?overlay=to quiet the browser alone.hot.statsOptionsis deprecated and will be removed in the next major release; itshash,timingsandchildrenkeys are now ignored, because they could leave a payload without the hash the client compares, or carry a child compilation's hash instead, which stopped updates applying and forced a full page reload on every rebuild. (by @alexander-akait in #2392)
Patch Changes
-
Fixed a crash when calling
invalidate()in plugin mode (isPlugin = true). Since the host (webpack-cli, webpack-dev-server, etc.) ownscompiler.watch(), the middleware now invalidates the host'swatchinginstead (each child compiler's one for aMultiCompileron webpack < 5.109). When nothing is watching it logs a warning and completes the callback, asclose()does, rather than leavinginvalidate(callback)waiting on a build that never runs. (by @bjohansebas in #2378) -
Reject with
403 Forbiddenthe requests whose resolved filename falls outsideoutputPath(GHSA-g84c-rxfj-3j2c). With apublicPathwithout a trailing slash, a sibling path sharing its prefix (/assets../secret) escaped the output root once the prefix was stripped and joined. (by @bjohansebas in #2404) -
Update the changelog generator to the
@changesets/get-github-info1.0 API. (by @alexander-akait in #2396) -
Update dependencies. (by @alexander-akait in #2394)
v7.4.6
v8.2.0
Minor Changes
- Added a
hotoption that enables hot module replacement, replacing the need forwebpack-hot-middleware. Passhot: trueto enable with defaults, orhot: { path, heartbeat, progress, statsOptions }to customize. The client runtime ships with the package and is added as a webpack entry. (by @bjohansebas in #2322)
v8.1.1
Patch Changes
- Fixed a crash when calling
close()in plugin mode (isPlugin = true). Since the host (webpack-cli, webpack-dev-server, etc.) ownscompiler.watch(), the middleware has nowatchingof its own to close, soclose()now just calls the callback instead of throwing. (by @bjohansebas in #2347)
v8.1.0
Minor Changes
- Reuse an already active
MultiCompilerwatching session instead of starting a duplicate one (requires webpack >= 5.109). (by @bjohansebas in #2371)
v8.0.4
Patch Changes
- Replace the
on-finisheddependency with Node.js built-instream.finished. (by @bjohansebas in #2346)
v8.0.3
Patch Changes
- Respect
req.urlwhen modified by middleware such asconnect-history-api-fallback. (by @bjohansebas in #2304)
v8.0.2
Patch Changes
- Fixed compatibility with rspack. (by @alexander-akait in #2295)
v8.0.1
Patch Changes
- Fixed compatibility with rspack. (by @alexander-akait in
0b40cfd)
v8.0.0
Major Changes
-
The
getFilenameFromUrlfunction is now asynchronous, returning a Promise that resolves to the object with the foundfilename(orundefinedif the file was not found) or throws an error if the URL cannot be processed. Additionally, the object contains theextraproperty withstats(file system stats) andoutputFileSystem(output file system where file was found) properties. (by @alexander-akait in #2284) -
Minimum supported
Node.jsversion is20.9.0. (by @alexander-akait in #2284) -
Minimum supported
webpackversion is5.101.0. (by @alexander-akait in #2284)
Minor Changes
-
Added support for plugin usage, useful when the middleware will be used as a webpack plugin (no stats output, no extra actions). (by @alexander-akait in #2284)
-
Added the
forwardErroroption to enable error forwarding to next middleware. (by @alexander-akait in #2284) -
Enable
cacheImmutableby default for immutable assets. (by @alexander-akait in #2284)
Patch Changes
-
Improved initial loading module time. (by @alexander-akait in #2284)
-
Removed outdated code and improved performance by avoiding extra loops. (by @alexander-akait in #2284)
All notable changes to this project will be documented in this file. See standard-version for commit guidelines.
7.4.5 (2025-09-24)
Bug Fixes
7.4.4 (2025-09-23)
Bug Fixes
7.4.3 (2025-09-05)
Bug Fixes
- do not call the next middleware for 304 responses (#2155) (c26a326)
- do not call the next middleware when request is finished or errored (#2156) (116c680)