Sha256: 07f2831b73eea2978ca5b5ca356b405fd8b0df2c8c82273e0e0349c53321cd33

Contents?: true

Size: 595 Bytes

Versions: 2

Compression:

Stored size: 595 Bytes

Contents

module Stimulus
  class Engine < ::Rails::Engine
    initializer "stimulus.assets" do
      if Rails.application.config.respond_to?(:assets)
        Rails.application.config.assets.precompile += %w( stimulus stimulus-autoloader )
      end
    end

    initializer "stimulus.importmap" do
      if Rails.application.config.respond_to?(:importmap)
        Rails.application.config.importmap.paths.tap do |paths|
          paths.asset "@hotwired/stimulus", path: "stimulus"
          paths.asset "@hotwired/stimulus-autoloader", path: "stimulus-autoloader"
        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
stimulus-rails-0.3.1 lib/stimulus/engine.rb
stimulus-rails-0.3.0 lib/stimulus/engine.rb