From 219a4fbbbc1884948174abf839d0e85041a82d00 Mon Sep 17 00:00:00 2001 From: Andreas Nedbal Date: Tue, 3 Jan 2023 12:30:30 +0100 Subject: [PATCH] Configure Sprockets to work with cssbundling-rails --- config/initializers/assets.rb | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/config/initializers/assets.rb b/config/initializers/assets.rb index fe48fc34..6dd055cd 100644 --- a/config/initializers/assets.rb +++ b/config/initializers/assets.rb @@ -10,3 +10,12 @@ Rails.application.config.assets.version = '1.0' # 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 ) + +# Enable Rails to resolve url() asset paths to digested assets +Rails.application.config.assets.resolve_assets_in_css_urls = true + +# Include node assets in asset loading +# This is IMPORTANT because in either environment (especially local) external assets +# will not be found/resolved otherwise +Rails.application.config.assets.paths << Rails.root.join("node_modules/font-awesome/fonts") +Rails.application.config.assets.paths << Rails.root.join("node_modules/@fontsource/lexend/files")