lib/amber_component/railtie.rb in amber_component-1.0.0 vs lib/amber_component/railtie.rb in amber_component-1.1.0

- old
+ new

@@ -2,11 +2,13 @@ module ::AmberComponent # Class which hooks into Rails # and configures the application. class Railtie < ::Rails::Railtie - initializer 'amber_component.initialization' do |app| + initializer 'amber_component.assets' do |app| app.config.assets.paths << (app.root / 'app' / 'components') + app.config.assets.paths << (ROOT_GEM_PATH / 'assets' / 'javascripts') + app.config.assets.precompile += %w[amber_component/stimulus_loading.js] next if ::Rails.env.production? components_root = app.root / 'app' / 'components' component_paths = ::Dir[components_root / '**' / '*.rb']