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 5, 2024
1 parent c50a884 commit 44e56fa
Show file tree
Hide file tree
Showing 3 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 @@ -11,6 +11,8 @@ coverage

# Ignore compiled assets
/public/assets
/app/assets/builds/*
!/app/assets/builds/.keep

# vim swap files and tags
*.sw[a-z]
Expand Down
2 changes: 1 addition & 1 deletion app/assets/config/manifest.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//= link_tree ../images
//= link application.css
//= link_tree ../builds
//= link application.js
//= link es6-components.js
//= link domain-config.js
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 44e56fa

Please sign in to comment.