From 9a4424822a8d3b3583504b827e1b7089b4319a30 Mon Sep 17 00:00:00 2001 From: Evan You Date: Tue, 26 May 2020 17:55:28 -0400 Subject: [PATCH] fix: fix import chain walking --- src/node/server/serverPluginHmr.ts | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/node/server/serverPluginHmr.ts b/src/node/server/serverPluginHmr.ts index 80d7d225923f86..45953099f1befb 100644 --- a/src/node/server/serverPluginHmr.ts +++ b/src/node/server/serverPluginHmr.ts @@ -218,7 +218,6 @@ function walkImportChain( return false } - let hasDeadEnd = false for (const importer of importers) { if (importer.endsWith('.vue') || isHmrAccepted(importer, importee)) { // vue boundaries are considered dirty for the reload @@ -230,19 +229,21 @@ function walkImportChain( } else { const parentImpoters = importerMap.get(importer) if (!parentImpoters) { - hasDeadEnd = true - } else { - hasDeadEnd = walkImportChain( + return true + } else if ( + walkImportChain( importer, parentImpoters, hmrBoundaries, dirtyFiles, currentChain.concat(importer) ) + ) { + return true } } } - return hasDeadEnd + return false } function isHmrAccepted(importer: string, dep: string): boolean {