Skip to content

Commit

Permalink
Merge pull request #3024 from alphagov/migrate-to-dart-sass
Browse files Browse the repository at this point in the history
Migrate to Dart Sass
  • Loading branch information
davidgisbey authored Jan 24, 2024
2 parents 4a94d27 + b6d212f commit c7b2862
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 11 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@
/npm-debug.log

/public/assets
/app/assets/builds/*
!/app/assets/builds/.keep

.byebug_history

/coverage
Expand Down
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ gem "rails", "7.1.3"

gem "aws-sdk-s3"
gem "bootsnap", require: false
gem "dartsass-rails"
gem "gds-api-adapters"
gem "gds-sso"
gem "govspeak"
Expand All @@ -22,7 +23,6 @@ gem "plek"
gem "rinku"
gem "rubyzip", require: "zip"
gem "sanitize"
gem "sassc-rails"
gem "sentry-sidekiq"
gem "sidekiq-scheduler"
gem "sprockets-rails"
Expand Down
22 changes: 13 additions & 9 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,9 @@ GEM
crack (0.4.5)
rexml
crass (1.0.6)
dartsass-rails (0.5.0)
railties (>= 6.0.0)
sass-embedded (~> 1.63)
date (3.3.4)
diff-lcs (1.5.0)
docile (1.4.0)
Expand Down Expand Up @@ -666,14 +669,15 @@ GEM
sanitize (6.1.0)
crass (~> 1.0.2)
nokogiri (>= 1.12.0)
sassc (2.4.0)
ffi (~> 1.9)
sassc-rails (2.1.2)
railties (>= 4.0.0)
sassc (>= 2.0)
sprockets (> 3.0)
sprockets-rails
tilt
sass-embedded (1.70.0)
google-protobuf (~> 3.25)
rake (>= 13.0.0)
sass-embedded (1.70.0-aarch64-linux-gnu)
google-protobuf (~> 3.25)
sass-embedded (1.70.0-arm64-darwin)
google-protobuf (~> 3.25)
sass-embedded (1.70.0-x86_64-linux-gnu)
google-protobuf (~> 3.25)
selenium-webdriver (4.16.0)
rexml (~> 3.2, >= 3.2.5)
rubyzip (>= 1.2.2, < 3.0)
Expand Down Expand Up @@ -754,6 +758,7 @@ DEPENDENCIES
brakeman
byebug
climate_control
dartsass-rails
factory_bot_rails
gds-api-adapters
gds-sso
Expand Down Expand Up @@ -781,7 +786,6 @@ DEPENDENCIES
rubocop-govuk
rubyzip
sanitize
sassc-rails
sentry-sidekiq
sidekiq-scheduler
simplecov
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 ../stylesheets .css
//= link_tree ../builds
//= link application.js
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
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 c7b2862

Please sign in to comment.