Skip to content

Commit

Permalink
fix(scan): set namespace when resolving to html (#2174)
Browse files Browse the repository at this point in the history
fix #2163
  • Loading branch information
jonaskuske committed Feb 22, 2021
1 parent e368cf7 commit 3be4fac
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/vite/src/node/optimizer/scan.ts
Original file line number Diff line number Diff line change
Expand Up @@ -298,8 +298,12 @@ function esbuildScanPlugin(
if (shouldExternalizeDep(resolved, id)) {
return externalUnlessEntry({ path: id })
}

const namespace = htmlTypesRE.test(resolved) ? 'html' : undefined

return {
path: path.resolve(cleanUrl(resolved))
path: path.resolve(cleanUrl(resolved)),
namespace
}
} else {
// resolve failed... probably usupported type
Expand Down

0 comments on commit 3be4fac

Please sign in to comment.