module AssetBox module Rails class Engine < ::Rails::Engine initializer 'asset_box.assets.precompile' do |app| %w(stylesheets javascripts images fonts).each do |sub| app.config.assets.paths << root.join('assets', sub).to_s end # sprockets-rails 3 tracks down the calls to `font_path` and `image_path` # and automatically precompiles the referenced assets. unless Sprockets::Rails::VERSION.split('.', 2)[0].to_i >= 3 app.config.assets.precompile << %r(bootstrap/glyphicons-halflings-regular\.(?:eot|svg|ttf|woff2?)$) end %w[eot svg ttf woff woff2].each do |ext| app.config.assets.precompile << "font-awesome/fa-brands-400.#{ext}" app.config.assets.precompile << "font-awesome/fa-regular-400.#{ext}" app.config.assets.precompile << "font-awesome/fa-solid-900.#{ext}" end end end end end