From 65c037aea068123960c0d2e692bf963c12213d3c Mon Sep 17 00:00:00 2001 From: Fran Dios Date: Mon, 27 May 2024 13:05:00 +0900 Subject: [PATCH] fix: do not externalize plugins that resolve to local files in monorepos --- packages/vite/src/node/config.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/vite/src/node/config.ts b/packages/vite/src/node/config.ts index 2b0f6d28360987..4d1362027c5971 100644 --- a/packages/vite/src/node/config.ts +++ b/packages/vite/src/node/config.ts @@ -1165,6 +1165,10 @@ async function bundleConfigFile( } if (idFsPath && isImport) { idFsPath = pathToFileURL(idFsPath).href + if (!idFsPath.includes('/node_modules/')) { + // resolved to a local import, consider it as a relative path + return + } } if ( idFsPath &&