From e2046f025d062bb37d427d3866fb850c101c92d1 Mon Sep 17 00:00:00 2001 From: Hiroshi Ogawa Date: Mon, 11 Nov 2024 15:11:31 +0900 Subject: [PATCH] chore: tweak --- packages/vite/src/node/server/environments/rolldown.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/vite/src/node/server/environments/rolldown.ts b/packages/vite/src/node/server/environments/rolldown.ts index ab06432473d527..54123bb59a5fef 100644 --- a/packages/vite/src/node/server/environments/rolldown.ts +++ b/packages/vite/src/node/server/environments/rolldown.ts @@ -399,11 +399,11 @@ function reactRefreshPlugin( }, }, async handler(id) { + if (!rolldownDevOptions.reactRefresh) { + return `export {}` + } const resolved = require.resolve('react-refresh/runtime') if (id === '\0virtual:react-refresh/entry') { - if (!rolldownDevOptions.reactRefresh) { - return `export {}` - } return ` import runtime from ${JSON.stringify(resolved)}; runtime.injectIntoGlobalHook(window);