Module: ReactOnRails::ShakapackerConfigHelpers
- Included in:
- Dev::ServerManager, Doctor, SystemChecker
- Defined in:
- lib/react_on_rails/shakapacker_config_helpers.rb
Overview
Shared helpers for reading config/shakapacker.yml and deriving the active assets bundler (webpack vs rspack), its display labels, and the development dev-server reload mode. Extracted so the diagnostics/CLI entry points (Doctor, SystemChecker, and Dev::ServerManager) parse the file the same way and present consistent bundler wording.
Doctor and SystemChecker include this module so the helpers become private
instance methods. Dev::ServerManager extends it because its commands live
on class << self; extend preserves the private visibility, so the helpers
become private singleton methods there. The helpers call each other plus
standard-library/Rails globals (ENV, File, Dir, YAML, ERB, Rails) and module
constants — none of which resolve through self — so they behave
identically whether included or extended.
Constant Summary collapse
- DEFAULT_SHAKAPACKER_CONFIG_PATH =
"config/shakapacker.yml"- SHAKAPACKER_ASSETS_BUNDLER_ENV =
"SHAKAPACKER_ASSETS_BUNDLER"- SUPPORTED_ASSETS_BUNDLERS =
%w[webpack rspack].freeze