Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/travis-r6s/gridsome-plugin-brotli
Gridsome plugin for preparing brotli-compressed versions of assets
https://github.com/travis-r6s/gridsome-plugin-brotli
Last synced: 16 days ago
JSON representation
Gridsome plugin for preparing brotli-compressed versions of assets
- Host: GitHub
- URL: https://github.com/travis-r6s/gridsome-plugin-brotli
- Owner: travis-r6s
- License: mit
- Created: 2020-01-15T11:59:21.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2022-02-10T18:07:13.000Z (almost 3 years ago)
- Last Synced: 2025-01-01T09:34:42.988Z (23 days ago)
- Language: JavaScript
- Homepage:
- Size: 67.4 KB
- Stars: 2
- Watchers: 3
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# gridsome-plugin-brotli
---
> This plugin has been deprecated in favour of https://github.com/agaengel/gridsome-plugin-precompress, and will receive no further updates.
---
Gridsome plugin for preparing brotli-compressed versions of assets.
> Forked from [gatsby-plugin-brotli](https://github.com/ovhemert/gatsby-plugin-brotli)
```bash
/app.7b37c0a7.js # 246kb
```
becomes
```bash
/app.7b37c0a7.js.br # 67kb
```## Requirements
This plugin will only generate the compressed files. To see them been served to the client, your Gridsome website should run on a production server that supports Brotli (`.br`) files. The Gridsome development server **does not** serve the compressed versions.
## Installation
With npm:
```bash
yarn add gridsome-plugin-brotli # or
npm install gridsome-plugin-brotli
```## Usage
`gridsome.config.js`
```javascript
module.exports = {
plugins: ['gridsome-plugin-brotli']
}
```# Options
By default, only `.css` and `.js` files are compressed, but you can override this with the `extensions` option.
```javascript
module.exports = {
plugins: [
{
use: 'gridsome-plugin-brotli',
options: {
extensions: ['css', 'html', 'js', 'svg', 'json']
}
}
]
}
```You can even place all the brotli-compressed files (only the brotli ones, the uncompressed ones will
be saved in the `dist` directory as usual) in a dedicated directory (ex. `dist/brotli`):```javascript
module.exports = {
plugins: [
{
use: 'gridsome-plugin-brotli',
options: {
path: 'brotli'
}
}
]
}
```## License
Licensed under [MIT](./LICENSE).
_NOTE: This plugin only generates output when run in `production` mode! To test, run: `gridsome build` and view the `dist` folder._