webpack-dev-middleware
Advanced tools
+10
-0
@@ -539,5 +539,15 @@ "use strict"; | ||
| middleware.ready(filledContext, callback); | ||
| // TODO for plugin usage (`isPlugin = true`) `watching` is `undefined` and this throws — | ||
| // invalidate the host's `compiler.watching` (each child's one for a `MultiCompiler`) instead | ||
| filledContext.watching.invalidate(); | ||
| }; | ||
| instance.close = (callback = noop) => { | ||
| // For plugin usage the host (webpack-cli, webpack-dev-server, etc.) owns `compiler.watch()`, | ||
| // so there is no `watching` of our own to close (`compiler.close()` on the host handles it) | ||
| if (!filledContext.watching) { | ||
| filledContext.logger.warn("The `close` method was called, but there is no own `watching` instance to close. When using the middleware as a plugin, the host owns watching, so use `compiler.close()` instead."); | ||
| callback(null); | ||
| return; | ||
| } | ||
| filledContext.watching.close(callback); | ||
@@ -544,0 +554,0 @@ }; |
+1
-1
| { | ||
| "name": "webpack-dev-middleware", | ||
| "version": "8.1.0", | ||
| "version": "8.1.1", | ||
| "description": "A development middleware for webpack", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
143021
0.48%3382
0.27%