lib/active_admin/engine.rb in activeadmin-4.0.0.beta3 vs lib/active_admin/engine.rb in activeadmin-4.0.0.beta4
- old
+ new
@@ -13,10 +13,13 @@
if app.config.respond_to?(:assets)
app.config.assets.precompile += %w(active_admin.js active_admin.css active_admin_manifest.js)
end
end
- initializer "active_admin.importmap", before: "importmap" do |app|
+ initializer "active_admin.importmap", after: "importmap" do |app|
+ # Skip if importmap-rails is not installed
+ next unless app.config.respond_to?(:importmap)
+
ActiveAdmin.importmap.draw(Engine.root.join("config", "importmap.rb"))
package_path = Engine.root.join("app/javascript")
if app.config.respond_to?(:assets)
app.config.assets.paths << package_path
app.config.assets.paths << Engine.root.join("vendor/javascript")