Skip to content

Commit

Permalink
fix: onResolve is not called for glob imports
Browse files Browse the repository at this point in the history
  • Loading branch information
XiSenao committed Dec 9, 2023
1 parent 930d290 commit 28a57cb
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions packages/vite/src/node/optimizer/scan.ts
Original file line number Diff line number Diff line change
Expand Up @@ -637,6 +637,16 @@ function esbuildScanPlugin(
contents,
}
})

// onResolve is not called for glob imports.
// we need to add that here as well until esbuild calls onResolve for glob imports.
// https://github.com/evanw/esbuild/issues/3317
build.onLoad({ filter: /.*/, namespace: 'file' }, () => {
return {
loader: 'js',
contents: 'export default {}',
}
})
},
}
}
Expand Down

0 comments on commit 28a57cb

Please sign in to comment.