We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 4752796 commit dd14c01Copy full SHA for dd14c01
src/resolve.ts
@@ -57,14 +57,11 @@ function _resolve (id: string, opts: ResolveOptions = {}): string {
57
_urls.push(DEFAULT_URL)
58
}
59
const urls = [..._urls]
60
- for (let url of _urls) {
+ for (const url of _urls) {
61
if (url.protocol === 'file:') {
62
- if (!url.pathname.match(/[^/]+\.[^/.]+$/)) {
63
- // URL does not ends with extension. It is probably a directory.
64
- url = new URL(url)
65
- url.pathname = joinURL(url.pathname, '_index.js')
66
- }
67
urls.push(new URL('./', url))
+ // If url is directory
+ urls.push(new URL(joinURL(url.pathname, '_index.js'), url))
68
// TODO: Remove in next major version seems not necessary
69
urls.push(new URL('./node_modules', url))
70
0 commit comments