Skip to content

Commit

Permalink
Use autoload instead of relative require
Browse files Browse the repository at this point in the history
  • Loading branch information
dhh committed Dec 21, 2024
1 parent 2af83b3 commit df856d0
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 2 deletions.
File renamed without changes.
3 changes: 1 addition & 2 deletions lib/importmap/engine.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class Engine < ::Rails::Engine
config.importmap.cache_sweepers = []
config.importmap.rescuable_asset_errors = []

config.autoload_once_paths = %W( #{root}/app/helpers )
config.autoload_once_paths = %W( #{root}/app/helpers #{root}/app/controllers )

initializer "importmap" do |app|
app.importmap = Importmap::Map.new
Expand Down Expand Up @@ -50,7 +50,6 @@ class Engine < ::Rails::Engine

initializer "importmap.concerns" do
ActiveSupport.on_load(:action_controller_base) do
require_relative "../../app/controllers/concerns/importmap/freshness"
extend Importmap::Freshness
end
end
Expand Down

0 comments on commit df856d0

Please sign in to comment.