File tree Expand file tree Collapse file tree 2 files changed +19
-7
lines changed
app/views/layouts/spotlight Expand file tree Collapse file tree 2 files changed +19
-7
lines changed Original file line number Diff line number Diff line change 1313 <% else %>
1414 <%= stylesheet_link_tag "application" %>
1515 <% end %>
16- <%= javascript_include_tag "application" %>
16+ <% if defined? Importmap %>
17+ <%= javascript_importmap_tags %>
18+ <% else %>
19+ <%= javascript_include_tag "application" %>
20+ <% end %>
1721 <%= csrf_meta_tags %>
1822 <%= content_for ( :head ) %>
1923 <%= description %>
Original file line number Diff line number Diff line change @@ -19,13 +19,21 @@ def add_js_rails6
1919 end
2020
2121 def add_manifest
22- # Blacklight 8 does not use this directory by default.
23- return unless File . exist? ( 'app/assets/javascripts' )
24-
25- append_to_file 'app/assets/javascripts/application.js' , "\n //= require_tree .\n "
2622 append_to_file 'app/assets/config/manifest.js' , "\n //= link spotlight/manifest.js"
27- # Rails installed importmap by default, but we don't have importmap + Blacklight 7 working yet.
28- remove_file 'app/javascript/application.js'
23+
24+ # Blacklight 8 does not use this directory by default.
25+ if File . exist? ( 'app/assets/javascripts' )
26+ append_to_file 'app/assets/javascripts/application.js' , "\n //= require_tree .\n "
27+ # Rails installed importmap by default, but we don't have importmap + Blacklight 7 working yet.
28+ remove_file 'app/javascript/application.js'
29+ else
30+ # install via importmap
31+ append_to_file 'app/javascript/application.js' do
32+ <<~CONTENT
33+ import Spotlight from "spotlight.esm"
34+ CONTENT
35+ end
36+ end
2937 end
3038
3139 def inject_spotlight_routes
You can’t perform that action at this time.
0 commit comments