项目作者: hansottowirtz

项目描述 :
Adds a Brotli exporter to Sprockets 🗜
高级语言: Ruby
项目地址: git://github.com/hansottowirtz/sprockets-exporters_pack.git
创建时间: 2016-08-30T14:28:18Z
项目社区:https://github.com/hansottowirtz/sprockets-exporters_pack

开源协议:MIT License

下载


Sprockets::ExportersPack

This gem aims to add some exporters to sprockets.

Currently, it has:

  • a Brotli exporter, which can be used with ngx_brotli.

Installation

Add this line to your Gemfile:

  1. gem 'sprockets-exporters_pack'

You probably need these too, as sprockets hasn’t been updated yet:

  1. gem 'sprockets', '>= 4.0.0.beta3', github: 'rails/sprockets'
  2. gem 'sprockets-rails', '>= 3.1.0'
  1. $ bundle install

Usage

With Rails, in application.rb:

  1. config.assets.configure do |env|
  2. env.register_exporter %w(text/css application/javascript image/svg+xml), Sprockets::ExportersPack::BrotliExporter
  3. end

Without Rails:

  1. env = Sprockets::Environment.new
  2. env.register_exporter %w(text/css application/javascript image/svg+xml), Sprockets::ExportersPack::BrotliExporter

Contributing

Yes please! Open an issue with exporters you want to see added.

License

The gem is available as open source under the terms of the MIT License.