https://github.com/valpackett/broccoli-brotli
Broccoli extension to apply brotli compression
https://github.com/valpackett/broccoli-brotli
broccoli broccoli-plugin brotli compression
Last synced: 2 months ago
JSON representation
Broccoli extension to apply brotli compression
- Host: GitHub
- URL: https://github.com/valpackett/broccoli-brotli
- Owner: valpackett
- License: mit
- Created: 2017-01-26T21:19:52.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2022-01-10T13:31:45.000Z (over 3 years ago)
- Last Synced: 2025-02-21T00:09:04.832Z (3 months ago)
- Topics: broccoli, broccoli-plugin, brotli, compression
- Language: JavaScript
- Size: 22.5 KB
- Stars: 2
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://www.npmjs.com/package/broccoli-brotli)
[](https://www.npmjs.com/package/broccoli-brotli)
[](https://mit-license.org/)# Broccoli Brotli plugin
Fork of [broccoli-zopfli](https://github.com/nickbruun/broccoli-zopfli) (which is a fork of [broccoli-gzip](https://github.com/salsify/broccoli-gzip)) to use Brotli instead of Zopfli instead of gzip to perform compression. All credit goes to the original authors of broccoli-{zopfli,gzip}.
## Installation
```bash
$ npm i broccoli-brotli
```## Example
```javascript
const Brotli = require('broccoli-brotli')const tree = new Brotli('app', {
extensions: ['js', 'css', 'svg']
})
```## Configuration
### `new Brotli(inputNode, options)`
---
`options.extensions` *{Array}* (required)
The file extensions that should be compressed.
---
`options.keepUncompressed` *{Boolean}* (optional, default `false`)
Whether to keep uncompressed versions of the files in the resulting tree.
---
`options.appendSuffix` *{Boolean}* (optional, default `true`)
Whether to append the `.br` extension suffix to compressed files.
---
`options.XXX`
Where `XXX` comes from [BrotliOptions](https://nodejs.org/dist/latest-v15.x/docs/api/zlib.html#zlib_class_brotlioptions).
---
## License
broccoli-brotli is, like broccoli-zopfli, distributed under the MIT license.