{"id":23652909,"url":"https://github.com/mynameiswhm/brotli-webpack-plugin","last_synced_at":"2025-04-04T10:09:10.288Z","repository":{"id":48354560,"uuid":"64473625","full_name":"mynameiswhm/brotli-webpack-plugin","owner":"mynameiswhm","description":"Prepare Brotli-compressed versions of assets to serve them with Content-Encoding: br","archived":false,"fork":false,"pushed_at":"2021-07-30T11:34:37.000Z","size":103,"stargazers_count":214,"open_issues_count":15,"forks_count":23,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-28T09:08:32.548Z","etag":null,"topics":["brotli","webpack"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mynameiswhm.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-07-29T10:49:23.000Z","updated_at":"2025-03-24T01:51:04.000Z","dependencies_parsed_at":"2022-08-29T07:41:29.221Z","dependency_job_id":null,"html_url":"https://github.com/mynameiswhm/brotli-webpack-plugin","commit_stats":null,"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mynameiswhm%2Fbrotli-webpack-plugin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mynameiswhm%2Fbrotli-webpack-plugin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mynameiswhm%2Fbrotli-webpack-plugin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mynameiswhm%2Fbrotli-webpack-plugin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mynameiswhm","download_url":"https://codeload.github.com/mynameiswhm/brotli-webpack-plugin/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247157283,"owners_count":20893220,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["brotli","webpack"],"created_at":"2024-12-28T17:22:22.873Z","updated_at":"2025-04-04T10:09:10.265Z","avatar_url":"https://github.com/mynameiswhm.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# brotli plugin for webpack\n\n[![Greenkeeper badge](https://badges.greenkeeper.io/mynameiswhm/brotli-webpack-plugin.svg)](https://greenkeeper.io/)\n\nThis plugin compresses assets with [Brotli](https://github.com/google/brotli) compression algorithm using [zlib](https://nodejs.org/api/zlib.html#zlib_zlib_brotlicompress_buffer_options_callback), [iltorb](https://github.com/MayhemYDG/iltorb#brotliencodeparams) or [brotli.js](https://github.com/foliojs/brotli.js) libraries for serving it with [ngx_brotli](https://github.com/google/ngx_brotli) or such.\n\n## Installation\n\n```\nnpm install --save-dev brotli-webpack-plugin\n```\n\n## Usage\n\n``` javascript\nvar BrotliPlugin = require('brotli-webpack-plugin');\nmodule.exports = {\n\tplugins: [\n\t\tnew BrotliPlugin({\n\t\t\tasset: '[path].br[query]',\n\t\t\ttest: /\\.(js|css|html|svg)$/,\n\t\t\tthreshold: 10240,\n\t\t\tminRatio: 0.8\n\t\t})\n\t]\n}\n```\n\nArguments:\n\n* `asset`: The target asset name. Defaults to `'[path].br[query]'`.\n  * `[file]` is replaced with the original asset file name.\n  * `[fileWithoutExt]` is replaced with the file name minus its extension, e.g. the `style` of `style.css`.\n  * `[ext]` is replaced with the file name extension, e.g. the `css` of `style.css`.\n  * `[path]` is replaced with the path of the original asset.\n  * `[query]` is replaced with the query.\n* `test`: All assets matching this RegExp are processed. Defaults to every asset.\n* `threshold`: Only assets bigger than this size (in bytes) are processed. Defaults to `0`.\n* `minRatio`: Only assets that compress better that this ratio are processed. Defaults to `0.8`.\n* `deleteOriginalAssets`: remove original files that were compressed with brotli. Default: false\n\nOptional arguments for Brotli (see [iltorb](https://github.com/MayhemYDG/iltorb#brotliencodeparams) doc for details):\n* `mode`: Default: 0,\n* `quality`: Default: 11,\n* `lgwin`: Default: 22,\n* `lgblock`: Default: 0,\n* `size_hint`: Default: 0,\n* `disable_literal_context_modeling`: Default: false\n\n## License\n\nHeavily copy-pasted from [webpack/compression-webpack-plugin](https://github.com/webpack/compression-webpack-plugin) by [Tobias Koppers](https://github.com/sokra).\n\nLicensed under [MIT](./LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmynameiswhm%2Fbrotli-webpack-plugin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmynameiswhm%2Fbrotli-webpack-plugin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmynameiswhm%2Fbrotli-webpack-plugin/lists"}