From 59754c471cf90cc9d30a48ff5fb819d90f443915 Mon Sep 17 00:00:00 2001 From: zodern Date: Mon, 18 Jan 2021 16:05:12 -0600 Subject: [PATCH] Ignore imports from hot-module-replacement package --- packages/hot-module-replacement/client.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/packages/hot-module-replacement/client.js b/packages/hot-module-replacement/client.js index 83eb07f5ba..393a3bf00e 100644 --- a/packages/hot-module-replacement/client.js +++ b/packages/hot-module-replacement/client.js @@ -24,6 +24,12 @@ const importedBy = Object.create(null); if (module._onRequire) { module._onRequire({ before(importedModule, parentId) { + if (parentId === module.id) { + // While applying updates we import modules to re-run them. + // Don't track those imports since we don't want them to affect + // if a future change to the file can be accepted + return; + } imported[parentId] = imported[parentId] || new Set(); imported[parentId].add(importedModule.id);