Skip to content

Commit 9d55518

Browse files
committed
Do not assume the config file exists during boot
1 parent 1a7402c commit 9d55518

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

lib/webpacker/railtie.rb

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,10 @@ class Webpacker::Engine < ::Rails::Engine
5454

5555
initializer "webpacker.remove_app_packs_from_the_autoload_paths" do
5656
Rails.application.config.before_initialize do
57-
source_path = Webpacker.config.source_path.to_s
58-
ActiveSupport::Dependencies.autoload_paths.delete(source_path)
57+
if Webpacker.config.config_path.exist?
58+
source_path = Webpacker.config.source_path.to_s
59+
ActiveSupport::Dependencies.autoload_paths.delete(source_path)
60+
end
5961
end
6062
end
6163
end

0 commit comments

Comments
 (0)