Skip to content

Commit

Permalink
resolve search paths of import statements in the query (fix #265)
Browse files Browse the repository at this point in the history
  • Loading branch information
itchyny committed Aug 28, 2024
1 parent 24c60a5 commit 7a1698a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion module_loader.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,9 @@ func (l *moduleLoader) LoadJSONWithMeta(name string, meta map[string]any) (any,
func (l *moduleLoader) lookupModule(name, extension string, meta map[string]any) (string, error) {
paths := l.paths
if path, ok := meta["search"].(string); ok {
paths = append([]string{path}, paths...)
if path = resolvePath(path, ""); path != "" {
paths = append([]string{path}, paths...)
}
}
for _, base := range paths {
path := filepath.Join(base, name+extension)
Expand Down

0 comments on commit 7a1698a

Please sign in to comment.