Skip to content

Commit

Permalink
Configure builds
Browse files Browse the repository at this point in the history
- Create .keep
- Update manifest file to use /builds directory
- Ignore /builds & /public/assets
- Add initialiser which supresses dependency deprecation warnings &
imports all stylesheets from GOV.UK Publishing Components
  • Loading branch information
davidgisbey committed Jan 23, 2024
1 parent 99e3579 commit b3af352
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 3 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@

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

# Ignore all logfiles and tempfiles.
/log/*.log
Expand All @@ -29,4 +31,4 @@
!.yarn/plugins
!.yarn/releases
!.yarn/sdks
!.yarn/versions
!.yarn/versions
Empty file added app/assets/builds/.keep
Empty file.
3 changes: 1 addition & 2 deletions app/assets/config/manifest.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
//= link_tree ../images
//= link application.css
//= link_tree ../builds
//= link application.js
//= link historical-edition.css
1 change: 1 addition & 0 deletions config/application.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
require "action_view/railtie"
# require "action_cable/engine"
require "rails/test_unit/railtie"
require "sprockets/railtie"

# Require the gems listed in Gemfile, including any gems
# you've limited to :test, :development, or :production.
Expand Down
9 changes: 9 additions & 0 deletions config/initializers/dartsass.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
APP_STYLESHEETS = {
"application.scss" => "application.css",
"historical-edition.scss" => "historical-edition.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 b3af352

Please sign in to comment.