From 0aa6a5b466cdc7fcdbaacca7ac5b7086db98d017 Mon Sep 17 00:00:00 2001 From: Michael Mok Date: Tue, 1 Mar 2022 00:47:47 +0100 Subject: [PATCH] fix: make loader injection respect virtual modules (#593) --- lib/utils/injectRefreshLoader.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/utils/injectRefreshLoader.js b/lib/utils/injectRefreshLoader.js index d375aa41..16cd9f7c 100644 --- a/lib/utils/injectRefreshLoader.js +++ b/lib/utils/injectRefreshLoader.js @@ -25,7 +25,7 @@ function injectRefreshLoader(moduleData, injectOptions) { if ( // Include and exclude user-specified files - match(moduleData.resource) && + match(moduleData.matchResource || moduleData.resource) && // Exclude files referenced as assets !moduleData.type.includes('asset') && // Skip react-refresh and the plugin's runtime utils to prevent self-referencing -