lib/jekyll/esm.rb in jekyll-esm-0.1.0 vs lib/jekyll/esm.rb in jekyll-esm-0.1.1
- old
+ new
@@ -20,10 +20,11 @@
import_maps = doc.search('script[type=importmap]')
import_maps.each do |value|
importmap = JSON.parse(value.children[0].content)
imports = importmap["imports"]
- imports.keys.each do |import|
+ imports.keys.each do |import_key|
+ import = import_key.split('/').first
pkg_path = File.join(page.site.source, 'node_modules', import)
# don't repeatedly attempt to install a package
return if Dir.exists?(pkg_path) && @@new_esm_packages.include?(import)