Skip to content

Commit c4489ea

Browse files
authoredOct 13, 2022
fix(config): partial deno support (#10446)
1 parent 3259006 commit c4489ea

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed
 

‎packages/vite/src/node/config.ts

+4
Original file line numberDiff line numberDiff line change
@@ -986,6 +986,10 @@ async function bundleConfigFile(
986986
build.onResolve({ filter: /.*/ }, ({ path: id, importer, kind }) => {
987987
// externalize bare imports
988988
if (id[0] !== '.' && !path.isAbsolute(id) && !isBuiltin(id)) {
989+
// partial deno support as `npm:` does not work in `tryNodeResolve`
990+
if (id.startsWith('npm:')) {
991+
return { external: true }
992+
}
989993
let idFsPath = tryNodeResolve(id, importer, options, false)?.id
990994
if (idFsPath && (isESM || kind === 'dynamic-import')) {
991995
idFsPath = pathToFileURL(idFsPath).href

0 commit comments

Comments
 (0)
Please sign in to comment.