Skip to content

Commit

Permalink
fix: Remove unnecessary trailing /index in the local path resolution (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
tleunen committed Feb 5, 2017
1 parent 7e5faf0 commit ac0c671
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ export function toPosixPath(modulePath) {
}

export function toLocalPath(p) {
return (p[0] !== '.')
? `./${p}`
: p;
return p
.replace(/\/index$/, '') // remove trailing /index
.replace(/^(?!\.)/, './'); // insert `./` to make it a local path
}

export function replaceExtension(p, ext) {
Expand Down

0 comments on commit ac0c671

Please sign in to comment.