diff --git a/packages/vite/src/node/optimizer/scan.ts b/packages/vite/src/node/optimizer/scan.ts index 91931168e67846..871263c60a7cac 100644 --- a/packages/vite/src/node/optimizer/scan.ts +++ b/packages/vite/src/node/optimizer/scan.ts @@ -282,9 +282,11 @@ function esbuildScanPlugin( } return externalUnlessEntry({ path: id }) } else { + const namespace = htmlTypesRE.test(resolved) ? 'html' : undefined // linked package, keep crawling return { - path: path.resolve(resolved) + path: path.resolve(resolved), + namespace } } } else {