Skip to content

Commit

Permalink
Prevent Webpacker precompile deprecation message
Browse files Browse the repository at this point in the history
  • Loading branch information
ahangarha committed Jan 9, 2024
1 parent 6f1ca20 commit 3c2bff9
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion lib/react_on_rails/configuration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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!
Expand Down Expand Up @@ -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

0 comments on commit 3c2bff9

Please sign in to comment.