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
  • Loading branch information
jon-kirwan committed Jan 5, 2024
1 parent c856876 commit a429ef0
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 17 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
/tmp

/public/assets
/app/assets/builds/*
!/app/assets/builds/.keep
/test/wraith/wip*
shots/*
/coverage
Expand Down
Empty file added app/assets/builds/.keep
Empty file.
18 changes: 1 addition & 17 deletions app/assets/config/manifest.js
Original file line number Diff line number Diff line change
@@ -1,20 +1,4 @@
//= link_tree ../images
//= link application.js
//= link webchat.js
//= link application.css
//= link components/_back-to-top.css
//= link components/_banner.css
//= link components/_contents-list-with-body.css
//= link components/_download-link.css
//= link components/_error-message.css
//= link components/_figure.css
//= link components/_important-metadata.css
//= link components/_published-dates.css
//= link components/_publisher-metadata.css
//= link views/_guide.css
//= link views/_html-publication.css
//= link views/_manual.css
//= link views/_published-dates-button-group.css
//= link views/_service_manual_guide.css
//= link views/_specialist-document.css
//= link views/_travel-advice.css
//= link_tree ../builds
23 changes: 23 additions & 0 deletions config/initializers/dartsass.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
APP_STYLESHEETS = {
"application.scss" => "application.css",
"components/_back-to-top.scss" => "components/_back-to-top.css",
"components/_banner.scss" => "components/_banner.css",
"components/_contents-list-with-body.scss" => "components/_contents-list-with-body.css",
"components/_download-link.scss" => "components/_download-link.css",
"components/_error-message.scss" => "components/_error-message.css",
"components/_figure.scss" => "components/_figure.css",
"components/_important-metadata.scss" => "components/_important-metadata.css",
"components/_publisher-metadata.scss" => "components/_publisher-metadata.css",
"views/_guide.scss" => "views/_guide.css",
"views/_html-publication.scss" => "views/_html-publication.css",
"views/_manual.scss" => "views/_manual.css",
"views/_published-dates-button-group.scss" => "views/_published-dates-button-group.css",
"views/_service_manual_guide.scss" => "views/_service_manual_guide.css",
"views/_specialist-document.scss" => "views/_specialist-document.css",
"views/_travel-advice.scss" => "views/_travel-advice.css",
}

all_stylesheets = APP_STYLESHEETS.merge(GovukPublishingComponents::Config.all_stylesheets)
Rails.application.config.dartsass.builds = all_stylesheets

Rails.application.config.dartsass.build_options << " --quiet-deps"

0 comments on commit a429ef0

Please sign in to comment.