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 c4214d4 commit b07eb3b
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 17 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ log/*.log
tmp/
coverage
public/assets
/app/assets/builds/*
!/app/assets/builds/.keep
node_modules
yarn-error.log
spec/reports/pacts
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
Expand Up @@ -2,21 +2,5 @@
//= link all.js
//= link application.js
//= link test-dependencies.js
//= link application.css

//= link components/_calendar.css
//= link components/_metadata.css
//= link components/_subscribe.css

//= link views/_calendars.css
//= link views/_cookie-settings.css
//= link views/_csv_preview.css
//= link views/_homepage.css
//= link views/_travel-advice.css
//= link views/_report-child-abuse.css
//= link views/_homepage_header.css

//= link views/_local-transaction.css
//= link views/_location_form.css
//= link views/_popular_links.css
//= link views/_homepage_more_on_govuk.css
//= link_tree ../builds
24 changes: 24 additions & 0 deletions config/initializers/dartsass.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
app_stylesheets = {
"application.scss" => "application.css",
"components/_calendar.scss" => "components/_calendar.css",
"components/_metadata.scss" => "components/_metadata.css",
"components/_subscribe.scss" => "components/_subscribe.css",
"views/_calendars.scss" => "views/_calendars.css",
"views/_cookie-settings.scss" => "views/_cookie-settings.css",
"views/_csv_preview.scss" => "views/_csv_preview.css",
"views/_homepage_header.scss" => "views/_homepage_header.css",
"views/_homepage_more_on_govuk_new.scss" => "views/_homepage_more_on_govuk_new.css",
"views/_homepage_more_on_govuk.scss" => "views/_homepage_more_on_govuk.css",
"views/_homepage_new.scss" => "views/_homepage_new.css",
"views/_homepage.scss" => "views/_homepage.css",
"views/_inverse_header.scss" => "views/_inverse_header.css",
"views/_links_and_search.scss" => "views/_links_and_search.css",
"views/_local-transaction.scss" => "views/_local-transaction.css",
"views/_location_form.scss" => "views/_location_form.css",
"views/_popular_links.scss" => "views/_popular_links.css",
"views/_report-child-abuse.scss" => "views/_report-child-abuse.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

0 comments on commit b07eb3b

Please sign in to comment.