Skip to content

Commit

Permalink
Fix relative paths in npm resolution.
Browse files Browse the repository at this point in the history
  • Loading branch information
can1357 committed Mar 12, 2024
1 parent 3490537 commit 408efed
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions npm/resolve.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ func (t *ExportTable) Resolve(str string) (out string, ok bool) {
return v.Resolve(".")
}
for k, v := range t.v {
k = strings.TrimPrefix(k, ".")
k = strings.TrimPrefix(k, "/")
if rest, ok := strings.CutSuffix(k, "/*"); ok {
if str == rest {
return v.Resolve(".")
Expand Down

0 comments on commit 408efed

Please sign in to comment.