File tree Expand file tree Collapse file tree 3 files changed +12
-0
lines changed
test_app/config/initializers Expand file tree Collapse file tree 3 files changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -51,4 +51,11 @@ class Webpacker::Engine < ::Rails::Engine
5151 app . config . javascript_path = Webpacker . config . source_path . relative_path_from ( Rails . root . join ( "app" ) ) . to_s
5252 end
5353 end
54+
55+ initializer "webpacker.remove_app_packs_from_the_autoload_paths" do
56+ Rails . application . config . before_initialize do
57+ source_path = Webpacker . config . source_path . to_s
58+ ActiveSupport ::Dependencies . autoload_paths . delete ( source_path )
59+ end
60+ end
5461end
Original file line number Diff line number Diff line change 1+ $test_app_autoload_paths_in_initializer = ActiveSupport ::Dependencies . autoload_paths
Original file line number Diff line number Diff line change @@ -27,4 +27,8 @@ def dev_server.running?; true; end
2727 assert Webpacker . inlining_css?
2828 end
2929 end
30+
31+ def test_app_autoload_paths_cleanup
32+ assert_empty $test_app_autoload_paths_in_initializer
33+ end
3034end
You can’t perform that action at this time.
0 commit comments