Skip to content

Commit

Permalink
fix(config): partial deno support (#10446)
Browse files Browse the repository at this point in the history
  • Loading branch information
bluwy authored Oct 13, 2022
1 parent 3259006 commit c4489ea
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/vite/src/node/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -986,6 +986,10 @@ async function bundleConfigFile(
build.onResolve({ filter: /.*/ }, ({ path: id, importer, kind }) => {
// externalize bare imports
if (id[0] !== '.' && !path.isAbsolute(id) && !isBuiltin(id)) {
// partial deno support as `npm:` does not work in `tryNodeResolve`
if (id.startsWith('npm:')) {
return { external: true }
}
let idFsPath = tryNodeResolve(id, importer, options, false)?.id
if (idFsPath && (isESM || kind === 'dynamic-import')) {
idFsPath = pathToFileURL(idFsPath).href
Expand Down

0 comments on commit c4489ea

Please sign in to comment.