From 0ed6d9a58cb4f77ad0eb514149a624e54aec1c80 Mon Sep 17 00:00:00 2001 From: Andrew Kane Date: Wed, 9 Oct 2024 11:08:41 -0700 Subject: [PATCH] Only add assets to precompile list for Sprockets --- lib/blazer/engine.rb | 34 ++++++++++++++++++---------------- 1 file changed, 18 insertions(+), 16 deletions(-) diff --git a/lib/blazer/engine.rb b/lib/blazer/engine.rb index 4034d4ff7..b92591717 100644 --- a/lib/blazer/engine.rb +++ b/lib/blazer/engine.rb @@ -3,22 +3,24 @@ class Engine < ::Rails::Engine isolate_namespace Blazer initializer "blazer" do |app| - if defined?(Sprockets) && Sprockets::VERSION.to_i >= 4 - app.config.assets.precompile += [ - "blazer/application.js", - "blazer/application.css", - "blazer/glyphicons-halflings-regular.eot", - "blazer/glyphicons-halflings-regular.svg", - "blazer/glyphicons-halflings-regular.ttf", - "blazer/glyphicons-halflings-regular.woff", - "blazer/glyphicons-halflings-regular.woff2", - "blazer/favicon.png" - ] - else - # use a proc instead of a string - app.config.assets.precompile << proc { |path| path =~ /\Ablazer\/application\.(js|css)\z/ } - app.config.assets.precompile << proc { |path| path =~ /\Ablazer\/.+\.(eot|svg|ttf|woff|woff2)\z/ } - app.config.assets.precompile << proc { |path| path == "blazer/favicon.png" } + if defined?(Sprockets) + if Sprockets::VERSION.to_i >= 4 + app.config.assets.precompile += [ + "blazer/application.js", + "blazer/application.css", + "blazer/glyphicons-halflings-regular.eot", + "blazer/glyphicons-halflings-regular.svg", + "blazer/glyphicons-halflings-regular.ttf", + "blazer/glyphicons-halflings-regular.woff", + "blazer/glyphicons-halflings-regular.woff2", + "blazer/favicon.png" + ] + else + # use a proc instead of a string + app.config.assets.precompile << proc { |path| path =~ /\Ablazer\/application\.(js|css)\z/ } + app.config.assets.precompile << proc { |path| path =~ /\Ablazer\/.+\.(eot|svg|ttf|woff|woff2)\z/ } + app.config.assets.precompile << proc { |path| path == "blazer/favicon.png" } + end end Blazer.time_zone ||= Blazer.settings["time_zone"] || Time.zone