Skip to content

Commit

Permalink
Add rake task assets:vendor
Browse files Browse the repository at this point in the history
This task runs before dartsass:build to ensures the required files are
present and that the assets are vendored
  • Loading branch information
fumimowdan committed Oct 19, 2023
1 parent 9fddd50 commit fa8dd82
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions lib/tasks/assets_vendor.rake
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
namespace :assets do
desc "Copy govuk-frontend assets to vendor assets folder"
task vendor: :environment do
node_govuk_assets_path = Rails.root.join("node_modules/govuk-frontend/govuk/assets")
govuk_assets_path = Rails.root.join("vendor/assets")

system("yarn --frozen-lockfile")
system("yarn cache clean")
system("mkdir -p #{govuk_assets_path}/assets")
system("cp -r #{node_govuk_assets_path} #{govuk_assets_path}")
end
end

Rake::Task["dartsass:build"].enhance(["assets:vendor"])

0 comments on commit fa8dd82

Please sign in to comment.