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
andysellick committed Aug 7, 2024
1 parent cd400c0 commit 865a832
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 1 deletion.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
!/log/.keep
/tmp/*
/coverage
/app/assets/builds/*
!/app/assets/builds/.keep

node_modules
yarn-error.log
Expand Down
Empty file added app/assets/builds/.keep
Empty file.
2 changes: 1 addition & 1 deletion app/assets/config/manifest.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
//= link_tree ../images
//= link_directory ../javascripts .js
//= link_directory ../stylesheets .css
//= 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 @@
APP_STYLESHEETS = {
"application.scss" => "application.css",
}.freeze

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 865a832

Please sign in to comment.