Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate to Dart Sass from LibSass #1655

Merged
merged 4 commits into from
Dec 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ tmp
log
/node_modules
yarn-error.log
public/assets
/public/assets
/app/assets/builds/*
!/app/assets/builds/.keep
coverage
.bundle
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ ruby "~> 3.2.0"
gem "rails", "7.1.2"

gem "bootsnap", require: false
gem "dartsass-rails"
gem "gds-api-adapters"
gem "govuk_app_config"
gem "govuk_personalisation"
gem "govuk_publishing_components"
gem "jwt"
gem "plek"
gem "ratelimit"
gem "sassc-rails"
gem "slimmer"
gem "sprockets-rails"
gem "uglifier"
Expand Down
24 changes: 13 additions & 11 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,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 All @@ -109,7 +112,6 @@ GEM
ruby2_keywords
erubi (1.12.0)
execjs (2.8.1)
ffi (1.15.5)
gds-api-adapters (92.0.0)
addressable
link_header
Expand Down Expand Up @@ -546,14 +548,15 @@ GEM
ruby-progressbar (1.13.0)
ruby2_keywords (0.0.5)
rubyzip (2.3.2)
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.69.5)
google-protobuf (~> 3.23)
rake (>= 13.0.0)
sass-embedded (1.69.5-aarch64-linux-gnu)
google-protobuf (~> 3.23)
sass-embedded (1.69.5-arm64-darwin)
google-protobuf (~> 3.23)
sass-embedded (1.69.5-x86_64-linux-gnu)
google-protobuf (~> 3.23)
selenium-webdriver (4.16.0)
rexml (~> 3.2, >= 3.2.5)
rubyzip (>= 1.2.2, < 3.0)
Expand Down Expand Up @@ -586,7 +589,6 @@ GEM
statsd-ruby (1.5.0)
stringio (3.1.0)
thor (1.3.0)
tilt (2.0.10)
timecop (0.9.8)
timeout (0.4.1)
tzinfo (2.0.6)
Expand Down Expand Up @@ -617,6 +619,7 @@ DEPENDENCIES
bootsnap
capybara
climate_control
dartsass-rails
gds-api-adapters
govuk_app_config
govuk_personalisation
Expand All @@ -630,7 +633,6 @@ DEPENDENCIES
ratelimit
rspec-rails
rubocop-govuk
sassc-rails
simplecov
slimmer
sprockets-rails
Expand Down
Empty file added app/assets/builds/.keep
Empty file.
2 changes: 2 additions & 0 deletions app/assets/config/manifest.js
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
//= link application.js

//= link_tree ../builds
2 changes: 0 additions & 2 deletions config/application.rb
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,5 @@ class Application < Rails::Application
# to use CSS that has same function names as SCSS such as max.
# https://github.com/alphagov/govuk-frontend/issues/1350
config.assets.css_compressor = nil

config.assets.precompile << get_component_css_paths
end
end
3 changes: 0 additions & 3 deletions config/environments/production.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,6 @@
# Compress JS using a preprocessor.
config.assets.js_compressor = :uglifier

# Compress CSS using a preprocessor.
# config.assets.css_compressor = :sass

# Do not fallback to assets pipeline if a precompiled asset is missed.
config.assets.compile = false

Expand Down
6 changes: 6 additions & 0 deletions config/initializers/dartsass.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
APP_STYLESHEETS = {
"application.scss" => "application.css",
}.freeze

all_stylesheets = APP_STYLESHEETS.merge(GovukPublishingComponents::Config.all_stylesheets)
Rails.application.config.dartsass.builds = all_stylesheets