Skip to content

About

Adds a Brotli exporter to Sprockets 🗜

Resources

Code of conduct

Stars

0 stars

Watchers

0 watching

Forks

 
 

Latest commit

 

History

10 Commits

Folders and files

Repository files navigation

Sprockets::ExportersPack

This gem aims to add some exporters to sprockets.

Currently, it has:

Installation

Add this line to your Gemfile:

gem 'sprockets-exporters_pack'

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

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

Usage

With Rails, in application.rb:

config.assets.configure do |env|
  # Brotli
  env.register_exporter %w(text/css application/javascript image/svg+xml), Sprockets::ExportersPack::BrotliExporter
  # Zstd
  env.register_exporter %w(text/css application/javascript image/svg+xml), Sprockets::ExportersPack::ZstdExporter
end

Without Rails:

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

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.

About

Adds a Brotli exporter to Sprockets 🗜

Resources

Code of conduct

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages