Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/daliborgogic/nuxt-brotli
Nuxt.js module which compresses assets with Brotli compression algorithm using `iltorb` library for serving it with `ngx_brotli`
https://github.com/daliborgogic/nuxt-brotli
brotli module nuxt plugin webpack
Last synced: 17 days ago
JSON representation
Nuxt.js module which compresses assets with Brotli compression algorithm using `iltorb` library for serving it with `ngx_brotli`
- Host: GitHub
- URL: https://github.com/daliborgogic/nuxt-brotli
- Owner: daliborgogic
- Created: 2018-09-14T22:20:03.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2022-04-28T16:40:52.000Z (over 2 years ago)
- Last Synced: 2024-10-10T17:41:20.140Z (about 1 month ago)
- Topics: brotli, module, nuxt, plugin, webpack
- Language: JavaScript
- Homepage: https://www.npmjs.com/package/nuxt-brotli
- Size: 192 KB
- Stars: 19
- Watchers: 3
- Forks: 1
- Open Issues: 11
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
Awesome Lists containing this project
README
# nuxt-brotli
> This [Nuxt.js](https://github.com/nuxt) module compresses assets with Brotli compression algorithm using [iltorb](https://github.com/MayhemYDG/iltorb) library for serving it with [ngx_brotli](https://github.com/google/ngx_brotli).
## Installation
```bash
$ npm i nuxt-brotli
```## Usage
Add ```nuxt-brotli``` to modules section of ```nuxt.config.js```
```javascript
{
modules: ['nuxt-brotli']
}
```Arguments:
* `asset`: The target asset name. Defaults to `'[path].br[query]'`.
* `[file]` is replaced with the original asset file name.
* `[fileWithoutExt]` is replaced with the file name minus its extension, e.g. the `style` of `style.css`.
* `[ext]` is replaced with the file name extension, e.g. the `css` of `style.css`.
* `[path]` is replaced with the path of the original asset.
* `[query]` is replaced with the query.
* `test`: All assets matching this RegExp are processed. Defaults to ```/\.(js|css|html|svg)$/```.
* `threshold`: Only assets bigger than this size (in bytes) are processed. Defaults to `0`.
* `minRatio`: Only assets that compress better that this ratio are processed. Defaults to `0.8`.
* `deleteOriginalAssets`: remove original files that were compressed with brotli. Default: falseOptional arguments for Brotli (see [iltorb](https://github.com/MayhemYDG/iltorb#brotliencodeparams) doc for details):
* `mode`: Default: 0,
* `quality`: Default: 11,
* `lgwin`: Default: 22,
* `lgblock`: Default: 0,
* `size_hint`: Default: 0,
* `disable_literal_context_modeling`: Default: false# License
[Nuxt.js](https://github.com/nuxt)
[iltorb](https://github.com/MayhemYDG/iltorb)
[brotli plugin for webpack](https://github.com/mynameiswhm/brotli-webpack-plugin)
[MIT](https://opensource.org/licenses/MIT)