From 3e6c47cef6b439acbe1aaff6a3fee389ae2c0e28 Mon Sep 17 00:00:00 2001 From: Artem Batura Date: Mon, 4 Feb 2019 00:46:51 +0300 Subject: [PATCH] fix(routes): Allow HMR with warnings --- .gitignore | 1 + lib/routes.js | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 56e9332..05104ca 100644 --- a/.gitignore +++ b/.gitignore @@ -3,6 +3,7 @@ npm-debug.log coverage node_modules .eslintcache +.idea test/**/output* output.js diff --git a/lib/routes.js b/lib/routes.js index d7001dd..46de04c 100644 --- a/lib/routes.js +++ b/lib/routes.js @@ -46,8 +46,9 @@ const setupRoutes = function setupRoutes() { socket.lastHash = hash; const { errors = [], warnings = [] } = stats.toJson(statsOptions); + const hasErrors = Boolean(errors.length); - if (errors.length || warnings.length) { + if (hasErrors || warnings.length) { socket.send( prep({ action: 'problems', @@ -60,7 +61,7 @@ const setupRoutes = function setupRoutes() { }) ); - return; + if (hasErrors) return; } if (options.hmr || options.liveReload) {