Skip to content

Commit

Permalink
Ensure builds are added and stylesheets removed under Sprockets
Browse files Browse the repository at this point in the history
  • Loading branch information
dhh committed Feb 19, 2022
1 parent 083f9ef commit 1973162
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions lib/install/dartsass.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@
empty_directory "app/assets/builds"
keep_file "app/assets/builds"

if (sprockets_manifest_path = Rails.root.join("app/assets/config/manifest.js")).exist?
append_to_file sprockets_manifest_path, %(//= link_tree ../builds\n)

say "Stop linking stylesheets automatically"
gsub_file "app/assets/config/manifest.js", "//= link_directory ../stylesheets .css\n", ""
end

if Rails.root.join(".gitignore").exist?
append_to_file(".gitignore", %(\n/app/assets/builds/*\n!/app/assets/builds/.keep\n))
end
Expand Down

0 comments on commit 1973162

Please sign in to comment.