webpack-hot-middleware
Advanced tools
Comparing version 2.25.4 to 2.26.0
@@ -5,2 +5,9 @@ # Changelog | ||
### [2.26.0](https://github.com/webpack/webpack-dev-middleware/compare/v2.25.4...v2.26.0) (2023-12-25) | ||
### Feature | ||
* added the `statsOption` option | ||
### [2.25.4](https://github.com/webpack/webpack-dev-middleware/compare/v2.25.3...v2.25.4) (2023-06-21) | ||
@@ -7,0 +14,0 @@ |
@@ -12,2 +12,4 @@ module.exports = webpackHotMiddleware; | ||
opts.heartbeat = opts.heartbeat || 10 * 1000; | ||
opts.statsOptions = | ||
typeof opts.statsOptions == 'undefined' ? {} : opts.statsOptions; | ||
@@ -35,3 +37,9 @@ var eventStream = createEventStream(opts.heartbeat); | ||
latestStats = statsResult; | ||
publishStats('built', latestStats, eventStream, opts.log); | ||
publishStats( | ||
'built', | ||
latestStats, | ||
eventStream, | ||
opts.log, | ||
opts.statsOptions | ||
); | ||
} | ||
@@ -45,3 +53,3 @@ var middleware = function (req, res, next) { | ||
// the server | ||
publishStats('sync', latestStats, eventStream); | ||
publishStats('sync', latestStats, eventStream, false, opts.statsOptions); | ||
} | ||
@@ -120,13 +128,16 @@ }; | ||
function publishStats(action, statsResult, eventStream, log) { | ||
var statsOptions = { | ||
all: false, | ||
cached: true, | ||
children: true, | ||
modules: true, | ||
timings: true, | ||
hash: true, | ||
errors: true, | ||
warnings: true, | ||
}; | ||
function publishStats(action, statsResult, eventStream, log, statsOptions) { | ||
var resultStatsOptions = Object.assign( | ||
{ | ||
all: false, | ||
cached: true, | ||
children: true, | ||
modules: true, | ||
timings: true, | ||
hash: true, | ||
errors: true, | ||
warnings: true, | ||
}, | ||
statsOptions | ||
); | ||
@@ -139,3 +150,3 @@ var bundles = []; | ||
var processed = statsResult.stats.map(function (stats) { | ||
return extractBundles(normalizeStats(stats, statsOptions)); | ||
return extractBundles(normalizeStats(stats, resultStatsOptions)); | ||
}); | ||
@@ -145,3 +156,3 @@ | ||
} else { | ||
bundles = extractBundles(normalizeStats(statsResult, statsOptions)); | ||
bundles = extractBundles(normalizeStats(statsResult, resultStatsOptions)); | ||
} | ||
@@ -148,0 +159,0 @@ |
{ | ||
"name": "webpack-hot-middleware", | ||
"version": "2.25.4", | ||
"version": "2.26.0", | ||
"description": "Webpack hot reloading you can attach to your own server", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -99,2 +99,3 @@ # Webpack Hot Middleware | ||
* **overlayWarnings** - Set to `true` to enable client overlay on warnings in addition to errors. | ||
* **statsOptions** - An object to customize stats options. | ||
@@ -101,0 +102,0 @@ > Note: |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
33252
720
204