Sha256: d05da7ae77cd82a27569da72edd86d999d78631d484d77db5d037893ca383268

Contents?: true

Size: 756 Bytes

Versions: 1

Compression:

Stored size: 756 Bytes

Contents

module CssSplitter
  class Engine < ::Rails::Engine
    initializer 'css_splitter.sprockets_engine', after: 'sprockets.environment', group: :all do |app|
      if app.config.assets.public_methods.include? :configure
        app.config.assets.configure do |assets|
          assets.register_bundle_processor 'text/css', CssSplitter::SprocketsEngine
        end
      else
        app.assets.register_bundle_processor 'text/css', CssSplitter::SprocketsEngine
      end
    end

    initializer 'css_splitter.action_controller' do |app|
      ActiveSupport.on_load :action_controller do
        # Not all controllers use helpers (such as API based controllers)
        helper CssSplitter::ApplicationHelper if respond_to?(:helper)
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
css_splitter-0.4.6 lib/css_splitter/engine.rb