From 0fbe8b1524afa5c3163b4def999e37a53560d388 Mon Sep 17 00:00:00 2001 From: Mostafa Ahangarha Date: Fri, 5 Jan 2024 19:24:41 +0330 Subject: [PATCH] Prevent Webpacker precompile deprecation message --- lib/react_on_rails/configuration.rb | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/lib/react_on_rails/configuration.rb b/lib/react_on_rails/configuration.rb index 33310ecea3..b14d580d9a 100644 --- a/lib/react_on_rails/configuration.rb +++ b/lib/react_on_rails/configuration.rb @@ -141,7 +141,7 @@ def adjust_precompile_task return if skip_react_on_rails_precompile || build_production_command.blank? - if Webpacker.config.webpacker_precompile? + if shakapacker_precompile? msg = <<~MSG React on Rails and Shakapacker error in configuration! @@ -266,6 +266,14 @@ def raise_missing_components_subdirectory raise ReactOnRails::Error, msg end + + def shakapacker_precompile? + config = Webpacker.config + + return config.webpacker_precompile? unless config.respond_to?(:shakapacker_precompile?) + + config.shakapacker_precompile? + end end end # rubocop:enable Metrics/ClassLength