diff --git a/Gemfile b/Gemfile index 05fc138f..5e1a7e9a 100644 --- a/Gemfile +++ b/Gemfile @@ -12,7 +12,6 @@ gem "okcomputer" gem "pg", "~> 1.5" gem "puma", "~> 6.4" gem "rails", "~> 7.0.8" -gem "sprockets-rails" gem "tzinfo-data", platforms: %i[mingw mswin x64_mingw jruby] gem "pagy" @@ -88,3 +87,5 @@ gem "mail-notify", "~> 1.1" gem "dartsass-rails", "~> 0.5.0" gem "importmap-rails", "~> 1.2" + +gem "propshaft", "~> 0.7.0" diff --git a/Gemfile.lock b/Gemfile.lock index c8c09b58..7a798047 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -290,6 +290,11 @@ GEM racc pg (1.5.4) phonelib (0.8.4) + propshaft (0.7.0) + actionpack (>= 7.0.0) + activesupport (>= 7.0.0) + rack + railties (>= 7.0.0) pry (0.14.2) coderay (~> 1.1) method_source (~> 1.0) @@ -435,13 +440,6 @@ GEM snaky_hash (2.0.1) hashie version_gem (~> 1.1, >= 1.1.1) - sprockets (4.2.0) - concurrent-ruby (~> 1.0) - rack (>= 2.2.4, < 4) - sprockets-rails (3.4.2) - actionpack (>= 5.2) - activesupport (>= 5.2) - sprockets (>= 3.0.0) thor (1.2.2) timeout (0.4.0) tzinfo (2.0.6) @@ -505,6 +503,7 @@ DEPENDENCIES pagy pg (~> 1.5) phonelib + propshaft (~> 0.7.0) pry-byebug puma (~> 6.4) rails (~> 7.0.8) @@ -520,7 +519,6 @@ DEPENDENCIES sidekiq (~> 6.5) sidekiq-cron (~> 1.10) simplecov - sprockets-rails tzinfo-data uk_postcode web-console diff --git a/app/assets/config/manifest.js b/app/assets/config/manifest.js deleted file mode 100644 index f4c1b7f1..00000000 --- a/app/assets/config/manifest.js +++ /dev/null @@ -1,5 +0,0 @@ -//= link_tree ../images -//= link_tree ../builds -//= link_tree ../../javascript .js -//= link_tree ../../../vendor/javascript .js -//= link_tree ../../../vendor/assets diff --git a/app/assets/stylesheets/application.scss b/app/assets/stylesheets/application.scss index 219c2c51..e6afc6e3 100644 --- a/app/assets/stylesheets/application.scss +++ b/app/assets/stylesheets/application.scss @@ -1,3 +1,5 @@ // Sassy -@import 'govuk-frontend/govuk/all'; -@import 'custom'; +@use 'govuk-frontend/govuk/all' with ( + $govuk-assets-path: "" +); +@use 'custom'; diff --git a/app/views/layouts/admin.html.erb b/app/views/layouts/admin.html.erb index 8ed83f83..ff05917a 100644 --- a/app/views/layouts/admin.html.erb +++ b/app/views/layouts/admin.html.erb @@ -13,12 +13,12 @@ - - - - - - + + + + + + <%= stylesheet_link_tag 'application', 'data-turbolinks-track': 'reload' %> <%= javascript_importmap_tags %> diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index d365b7a1..f44e57a5 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -13,18 +13,18 @@ - - - - - - + + + + + + <%= stylesheet_link_tag 'application', 'data-turbolinks-track': 'reload' %> <%= javascript_importmap_tags %> - + diff --git a/config/initializers/assets.rb b/config/initializers/assets.rb index c9aa32a2..98ec86d0 100644 --- a/config/initializers/assets.rb +++ b/config/initializers/assets.rb @@ -1,15 +1,6 @@ -# frozen_string_literal: true +# Dartsass load-path +Rails.application.config.dartsass.build_options << " --load-path #{Rails.root.join('node_modules')} " -# Be sure to restart your server when you modify this file. - -# Version of your assets, change this if you want to expire all your assets. -Rails.application.config.assets.version = "1.0" -Rails.application.config.assets.paths << Rails.root.join("node_modules") - -# Add additional assets to the asset load path. -# Rails.application.config.assets.paths << Emoji.images_path - -# Precompile additional assets. -# application.js, application.css, and all non-JS/CSS in the app/assets -# folder are already added. -# Rails.application.config.assets.precompile += %w( admin.js admin.css ) +## Propshaft +Rails.application.config.assets.paths << Rails.root.join("vendor/assets") +Rails.application.config.assets.excluded_paths << Rails.root.join("app/assets/stylesheets")