lib/importmap/map.rb in importmap-rails-1.2.1 vs lib/importmap/map.rb in importmap-rails-1.2.2
- old
+ new
@@ -143,10 +143,10 @@
def module_name_from(filename, mapping)
[ mapping.under, filename.to_s.remove(filename.extname).remove(/\/?index$/).presence ].compact.join("/")
end
def module_path_from(filename, mapping)
- [ mapping.path || mapping.under, filename.to_s ].compact.join("/")
+ [ mapping.path || mapping.under, filename.to_s ].compact.reject(&:empty?).join("/")
end
def find_javascript_files_in_tree(path)
Dir[path.join("**/*.js{,m}")].collect { |file| Pathname.new(file) }.select(&:file?)
end