We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 7e5faf0 commit ac0c671Copy full SHA for ac0c671
1 file changed
src/utils.js
@@ -5,9 +5,9 @@ export function toPosixPath(modulePath) {
5
}
6
7
export function toLocalPath(p) {
8
- return (p[0] !== '.')
9
- ? `./${p}`
10
- : p;
+ return p
+ .replace(/\/index$/, '') // remove trailing /index
+ .replace(/^(?!\.)/, './'); // insert `./` to make it a local path
11
12
13
export function replaceExtension(p, ext) {
0 commit comments