Sha256: 1706565a920337d887ff02800c3b95672b6c07e4cc39a6dfb3c13c67841a031a

Contents?: true

Size: 923 Bytes

Versions: 1

Compression:

Stored size: 923 Bytes

Contents

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

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
asset_box-0.1.0 lib/asset_box/rails/engine.rb