Skip to content

Commit a9f7c41

Browse files
committed
Reject empty path values when generating module_path
1 parent 557766d commit a9f7c41

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/importmap/map.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ def module_name_from(filename, mapping)
145145
end
146146

147147
def module_path_from(filename, mapping)
148-
[ mapping.path || mapping.under, filename.to_s ].compact.join("/")
148+
[ mapping.path || mapping.under, filename.to_s ].compact.reject(&:empty?).join("/")
149149
end
150150

151151
def find_javascript_files_in_tree(path)

0 commit comments

Comments
 (0)