webpack-hot-middleware
Advanced tools
Comparing version 2.1.0 to 2.2.0
module.exports = webpackHotMiddleware; | ||
var helpers = require('./helpers'); | ||
var pathMatch = helpers.pathMatch; | ||
function webpackHotMiddleware(compiler, opts) { | ||
@@ -29,3 +32,3 @@ opts = opts || {}; | ||
return function(req, res, next) { | ||
if (req.url !== opts.path) return next(); | ||
if (!pathMatch(req.url, opts.path)) return next(); | ||
eventStream.handler(req, res); | ||
@@ -32,0 +35,0 @@ }; |
{ | ||
"name": "webpack-hot-middleware", | ||
"version": "2.1.0", | ||
"version": "2.2.0", | ||
"description": "Webpack hot reloading you can attach to your own server", | ||
"main": "middleware.js", | ||
"scripts": { | ||
"test": "echo \"Maybe someday\"" | ||
"test": "mocha" | ||
}, | ||
@@ -17,3 +17,6 @@ "repository": { | ||
"strip-ansi": "^2.0.1" | ||
}, | ||
"devDependencies": { | ||
"mocha": "^2.3.2" | ||
} | ||
} |
@@ -87,2 +87,16 @@ # Webpack Hot Middleware | ||
## Troubleshooting | ||
### Use on browsers without EventSource | ||
If you want to use this module with browsers that don't support eventsource, you'll need to use a [polyfill](https://libraries.io/search?platforms=NPM&q=eventsource+polyfill). See [issue #11](https://github.com/glenjamin/webpack-hot-middleware/issues/11) | ||
### Not receiving updates in client when using Gzip | ||
This is because gzip generally buffers the response, but the Server Sent Events event-stream expects to be able to send data to the client immediately. You should make sure gzipping isn't being applied to the event-stream. See [issue #10](https://github.com/glenjamin/webpack-hot-middleware/issues/10). | ||
### Use with auto-restarting servers | ||
This module expects to remain running while you make changes to your webpack bundle, if you use a process manager like nodemon then you will likely see very slow changes on the client side. If you want to reload the server component, either use a separate process, or find a way to reload your server routes without restarting the whole process. | ||
## License | ||
@@ -89,0 +103,0 @@ |
Sorry, the diff of this file is not supported yet
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
20114
19
383
106
1