From 9aa2abfeebfd8ca651d8e13573fcf607217e7c37 Mon Sep 17 00:00:00 2001 From: Islam Sharabash Date: Mon, 30 May 2016 12:05:51 -0700 Subject: [PATCH] Removing watching/watching.running check Given that `state` should always have the correct value (if the bundle is valid or not) then we should be able to use ready directly without checking the watcher. I also hit a bug where the watcher had running set to false while the bundle was invalid, leading to a callback being executed immediately instead of waiting. --- middleware.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/middleware.js b/middleware.js index 0cb1b2f25..0712bd6d6 100644 --- a/middleware.js +++ b/middleware.js @@ -225,8 +225,7 @@ module.exports = function(compiler, options) { webpackDevMiddleware.waitUntilValid = function(callback) { callback = callback || function(){}; - if (!watching || !watching.running) callback(); - else ready(callback, {}); + ready(callback, {}); }; webpackDevMiddleware.invalidate = function(callback) {