Skip to content

Commit

Permalink
Configure builds
Browse files Browse the repository at this point in the history
- Create `dartsass.builds` initializer and add all Sass files to be compiled. See https://github.com/rails/dartsass-rails#configuring-builds
- Create .keep
- Update manifest file to use /builds directory
- Ignore /builds

Co-Authored-By: Martin Jones <[email protected]>
  • Loading branch information
jon-kirwan and MartinJJones committed Dec 11, 2023
1 parent 85cad13 commit 9c70320
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 5 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
tmp/*
log/*.log
public/assets
/app/assets/builds
!/app/assets/builds/.keep

# See https://yarnpkg.com/getting-started/qa#which-files-should-be-gitignored
.yarn/cache/
Expand Down
Empty file added app/assets/builds/.keep
Empty file.
6 changes: 1 addition & 5 deletions app/assets/config/manifest.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
//= link_tree ../images
//= link application.js
//= link test-dependencies.js
//= link application-ie8.css
//= link application-print.css
//= link application.css
//= link guides-print.css
//= link print.css
//= link modules/base-target.js
//= link_tree ../builds
8 changes: 8 additions & 0 deletions config/initializers/dartsass.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# config/initializers/dartsass.rb
Rails.application.config.dartsass.builds = {
"application-ie8.scss" => "application-ie8.css",
"application-print.scss" => "application-print.css",
"application.scss" => "application.css",
"guides-print.scss" => "guides-print.css",
"print.scss" => "print.css",
}

0 comments on commit 9c70320

Please sign in to comment.