From 73ad70711729618388dec1349062ca452f6a6e0e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Barr=C3=A9?= Date: Fri, 12 Aug 2022 07:07:34 +0200 Subject: [PATCH] fix(config): don't use file url for external files with cjs output (#9642) --- packages/vite/src/node/config.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/vite/src/node/config.ts b/packages/vite/src/node/config.ts index fa0a25e463b811..f29d06e27e29e2 100644 --- a/packages/vite/src/node/config.ts +++ b/packages/vite/src/node/config.ts @@ -980,7 +980,7 @@ async function bundleConfigFile( if (path.relative(idPkgDir, fileName).startsWith('..')) { return { // normalize actual import after bundled as a single vite config - path: pathToFileURL(idFsPath).href, + path: isESM ? pathToFileURL(idFsPath).href : idFsPath, external: true } }