Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

webpack-hot-middleware

Package Overview
Dependencies
Maintainers
1
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.14.0 to 2.15.0

9

client.js

@@ -10,3 +10,4 @@ /*eslint-env browser*/

log: true,
warn: true
warn: true,
name: ''
};

@@ -23,2 +24,5 @@ if (__resourceQuery) {

}
if (overrides.name) {
options.name = overrides.name
}
if (overrides.quiet && overrides.quiet !== 'false') {

@@ -149,2 +153,5 @@ options.log = false;

case "sync":
if (obj.name && options.name && obj.name !== options.name) {
return;
}
if (obj.errors.length > 0) {

@@ -151,0 +158,0 @@ if (reporter) reporter.problems('errors', obj);

2

package.json
{
"name": "webpack-hot-middleware",
"version": "2.14.0",
"version": "2.15.0",
"description": "Webpack hot reloading you can attach to your own server",

@@ -5,0 +5,0 @@ "keywords": [

@@ -83,2 +83,3 @@ # Webpack Hot Middleware

* **path** - The path which the middleware is serving the event stream on
* **name** - Bundle name, specifically for multi-compiler mode
* **timeout** - The time to wait after a disconnection before attempting to reconnect

@@ -99,2 +100,26 @@ * **overlay** - Set to `false` to disable the DOM-based client-side overlay.

### Multi-compliler mode
If you're using multi-compiler mode (exporting an array of config in `webpack.config.js`), set `name` parameters to make sure bundles don't process each other's updates. For example:
```
// webpack.config.js
module.exports = [
{
name: 'mobile',
entry: {
vendor: 'vendor.js',
main: ['webpack-hot-middleware/client?name=mobile', 'mobile.js']
}
},
{
name: 'desktop',
entry: {
vendor: 'vendor.js',
main: ['webpack-hot-middleware/client?name=desktop', 'desktop.js']
}
}
]
```
## Other Frameworks

@@ -101,0 +126,0 @@

@@ -103,2 +103,40 @@ /* eslint-env mocha, browser */

context("with name options", function() {
beforeEach(function setup() {
global.__resourceQuery = '?name=test'; // eslint-disable-line no-underscore-dangle
global.window = {
EventSource: sinon.stub().returns({
close: sinon.spy()
})
};
});
beforeEach(loadClient);
it("should not trigger webpack if event obj name is different", function() {
var eventSource = window.EventSource.lastCall.returnValue;
eventSource.onmessage(makeMessage({
name: 'foo',
action: 'built',
time: 100,
hash: 'deadbeeffeddad',
errors: [],
warnings: [],
modules: []
}));
sinon.assert.notCalled(processUpdate);
});
it("should not trigger webpack on successful syncs if obj name is different", function() {
var eventSource = window.EventSource.lastCall.returnValue;
eventSource.onmessage(makeMessage({
name: 'bar',
action: 'sync',
time: 100,
hash: 'deadbeeffeddad',
errors: [],
warnings: [],
modules: []
}));
sinon.assert.notCalled(processUpdate);
});
});
context("with no browser environment", function() {

@@ -105,0 +143,0 @@ beforeEach(function setup() {

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