aboutsummaryrefslogtreecommitdiffstats
path: root/src/features/index.js
blob: 6a8bb9f70758a093bc5e8e401d4a58e2857193f0 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
=''/>


blob: 7deda0059517e0d371dd1fd9efa8f6c64d9ab29c (plain) (blame)
1
2
3
4
5
6
7
8
import path from 'path'
import fs from 'fs'

export function resolve (specifier, parentModuleURL, defaultResolver) {
  specifier = specifier.replace(/^\$/, path.resolve('.') + "/")
  specifier = fs.existsSync(specifier) && fs.lstatSync(specifier).isDirectory() ? `${specifier}/index` : specifier
  return defaultResolver(specifier, parentModuleURL)
}