Skip to content

Commit

Permalink
Add sourcemap for min and make min the default
Browse files Browse the repository at this point in the history
  • Loading branch information
dhh committed Nov 24, 2021
1 parent e2a1bb3 commit b842714
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 7 deletions.
6 changes: 1 addition & 5 deletions app/assets/javascripts/stimulus.min.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions app/assets/javascripts/stimulus.min.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion lib/install/stimulus_with_importmap.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

say "Pin Stimulus"
append_to_file "config/importmap.rb" do <<-RUBY
pin "@hotwired/stimulus", to: "stimulus.js", preload: true
pin "@hotwired/stimulus", to: "stimulus.min.js", preload: true
pin "@hotwired/stimulus-loading", to: "stimulus-loading.js", preload: true
pin_all_from "app/javascript/controllers", under: "controllers"
RUBY
Expand Down
2 changes: 1 addition & 1 deletion lib/stimulus/engine.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ module Stimulus
class Engine < ::Rails::Engine
initializer "stimulus.assets" do
if Rails.application.config.respond_to?(:assets)
Rails.application.config.assets.precompile += %w( stimulus.js stimulus.min.js )
Rails.application.config.assets.precompile += %w( stimulus.js stimulus.min.js stimulus.min.js.map )
end
end
end
Expand Down

0 comments on commit b842714

Please sign in to comment.