Socket
Socket
Sign inDemoInstall

webpack-hot-middleware

Package Overview
Dependencies
Maintainers
3
Versions
67
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

webpack-hot-middleware - npm Package Compare versions

Comparing version 2.25.4 to 2.26.0

7

CHANGELOG.md

@@ -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 @@

41

middleware.js

@@ -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:

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc