Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/hansottowirtz/sprockets-exporters_pack
Adds a Brotli exporter to Sprockets 🗜
https://github.com/hansottowirtz/sprockets-exporters_pack
brotli rails sprockets
Last synced: 2 months ago
JSON representation
Adds a Brotli exporter to Sprockets 🗜
- Host: GitHub
- URL: https://github.com/hansottowirtz/sprockets-exporters_pack
- Owner: hansottowirtz
- License: mit
- Created: 2016-08-30T14:28:18.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2024-04-07T08:13:01.000Z (10 months ago)
- Last Synced: 2024-11-15T05:03:03.976Z (3 months ago)
- Topics: brotli, rails, sprockets
- Language: Ruby
- Homepage:
- Size: 10.7 KB
- Stars: 15
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# Sprockets::ExportersPack
This gem aims to add some exporters to [sprockets][rails/sprockets].
Currently, it has:
- a Brotli exporter, which can be used with [ngx_brotli][google/ngx_brotli].## Installation
Add this line to your `Gemfile`:
```ruby
gem 'sprockets-exporters_pack'
```You probably need these too, as sprockets hasn't been updated yet:
```ruby
gem 'sprockets', '>= 4.0.0.beta3', github: 'rails/sprockets'
gem 'sprockets-rails', '>= 3.1.0'
``````bash
$ bundle install
```## Usage
With Rails, in `application.rb`:
```ruby
config.assets.configure do |env|
env.register_exporter %w(text/css application/javascript image/svg+xml), Sprockets::ExportersPack::BrotliExporter
end
```Without Rails:
```ruby
env = Sprockets::Environment.new
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](http://opensource.org/licenses/MIT).
[rails/sprockets]: https://github.com/rails/sprockets
[rails/rails]: https://github.com/rails/rails
[google/ngx_brotli]: https://github.com/google/ngx_brotli