From 307b96bce7881eeb85aeb7f7778eee2a74d3b518 Mon Sep 17 00:00:00 2001 From: Aleksei Burlakov Date: Sat, 7 Dec 2024 18:20:05 +0100 Subject: [PATCH] Dev: make sprockets-4.2 compatible Make it working with sprockets-4.2 (but don't bump the version in the Gemfile). --- hawk/app/assets/config/manifest.js | 5 ++--- hawk/config/initializers/assets.rb | 29 ++++++++--------------------- 2 files changed, 10 insertions(+), 24 deletions(-) diff --git a/hawk/app/assets/config/manifest.js b/hawk/app/assets/config/manifest.js index b53cc1fae..60b56016d 100644 --- a/hawk/app/assets/config/manifest.js +++ b/hawk/app/assets/config/manifest.js @@ -1,4 +1,3 @@ //= link_tree ../images -//= link_directory ../stylesheets .css -//= link_tree ../../assets/javascripts .js -//= link_tree ../../../vendor/assets/javascripts .js +//= link_directory ../javascripts .js +//= link_directory ../javascripts/locale .js \ No newline at end of file diff --git a/hawk/config/initializers/assets.rb b/hawk/config/initializers/assets.rb index 1e68cc286..3a736348c 100644 --- a/hawk/config/initializers/assets.rb +++ b/hawk/config/initializers/assets.rb @@ -4,26 +4,13 @@ Rails.application.config.tap do |config| config.assets.version = "1.0" - config.assets.precompile = [ - /locale\/.+\.(css|js)$/, - /gettext\.(css|js)$/, - /application\.(css|js)$/, - /authentication\.(css|js)$/, - /dashboard.(css|js)$/, - /ie\.(css|js)$/, - /vendor\.(css|js)$/, - /\.(jpg|png|gif|svg|ico|eot|woff|woff2|ttf)$/ + config.assets.precompile = %w( manifest.js ) + config.assets.precompile << [ + "gettext.css", "gettext.js", + "application.css","application.js", + "authentication.css", "authentication.js", + "dashboard.css", "dashboard.js", + "ie.css", "ie.js", + "vendor.css", "vendor.js" ] - - config.assets.paths << config.root.join( - "vendor", - "assets", - "fonts" - ) - - config.assets.paths << config.root.join( - "vendor", - "assets", - "images" - ) end