From 6b6fbbbf266a2dc492b66a56116343b62a344ba9 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 abb61f690..fbd433674 100644 --- a/middleware.js +++ b/middleware.js @@ -265,8 +265,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) {