{"id":13496279,"url":"https://github.com/alloc/vite-plugin-compress","last_synced_at":"2025-04-09T18:19:44.102Z","repository":{"id":40383778,"uuid":"332881248","full_name":"alloc/vite-plugin-compress","owner":"alloc","description":"Compress your bundle + assets from Vite","archived":false,"fork":false,"pushed_at":"2022-03-31T16:14:28.000Z","size":602,"stargazers_count":131,"open_issues_count":13,"forks_count":13,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-09T18:19:28.071Z","etag":null,"topics":["vite","vite-plugin"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/alloc.png","metadata":{"files":{"readme":"README.md","changelog":null,"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":"2021-01-25T20:56:23.000Z","updated_at":"2024-09-27T06:33:30.000Z","dependencies_parsed_at":"2022-07-12T18:01:35.435Z","dependency_job_id":null,"html_url":"https://github.com/alloc/vite-plugin-compress","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alloc%2Fvite-plugin-compress","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alloc%2Fvite-plugin-compress/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alloc%2Fvite-plugin-compress/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alloc%2Fvite-plugin-compress/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alloc","download_url":"https://codeload.github.com/alloc/vite-plugin-compress/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248085325,"owners_count":21045139,"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":["vite","vite-plugin"],"created_at":"2024-07-31T19:01:44.997Z","updated_at":"2025-04-09T18:19:44.083Z","avatar_url":"https://github.com/alloc.png","language":"TypeScript","funding_links":["https://paypal.me/alecdotbiz"],"categories":["TypeScript"],"sub_categories":[],"readme":"# vite-plugin-compress\n\n[![npm](https://img.shields.io/npm/v/vite-plugin-compress.svg)](https://www.npmjs.com/package/vite-plugin-compress)\n[![Code style: Prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Donate](https://img.shields.io/badge/Donate-PayPal-green.svg)](https://paypal.me/alecdotbiz)\n\n\u003e Compress your bundle + assets from Vite\n\n- Assets generated by Vite and assets from `./public` are compressed with Brotli\n- Images, sounds, WOFF2 fonts, and PDFs are *not* compressed with Brotli, since these formats are compressed by default\n- SVGs are further optimized with [svgo](https://github.com/svg/svgo)\n- PNGs are further optimized with [imagemin](https://github.com/imagemin/imagemin)\n- By default, files smaller than 1501 bytes are not compressed, since the [MTU](https://en.wikipedia.org/wiki/Maximum_transmission_unit) of a TCP packet is 1500 bytes\n- Compatible with [vite-ssr](https://github.com/frandiox/vite-ssr)\n  - Just add `exclude: [\"ssr-manifest.json\"]`\n\n\u0026nbsp;\n\n## Usage\n\n```ts\nimport compress from 'vite-plugin-compress'\n\nexport default {\n  plugins: [\n    compress(),\n  ]\n}\n```\n\n### Options\n\n- `quality: number`  \n  Higher quality means smaller file sizes.  \n  Defaults to max quality (11).\n\n- `threshold: number`  \n  Minimum file size (in bytes) to be compressed.  \n  Defaults to 1501.\n\n- `exclude: string[]`  \n  Globs to exclude certain files from being compressed.\n\n- `extensions: string[]`  \n  Additional extensions to compress with Brotli.  \n  \n  Default extensions include:  \n  - `.html`\n  - `.js`\n  - `.css`\n  - `.svg`\n  - `.json`\n\n- `svgo: object`  \n  Options for the SVG optimizer.  \n  More info [here](https://github.com/svg/svgo/#what-it-can-do).  \n\n  Default plugins include:  \n  - `removeViewBox: false`\n  - `removeDimensions: true`\n  - Plugins listed [here](https://github.com/svg/svgo/blob/master/.svgo.yml) are enabled\n\n- `pngquant: object`  \n  Options for the PNG optimizer.  \n  More info [here](https://www.npmjs.com/package/imagemin-pngquant#options).\n\n- `brotli: boolean`  \n  Set to false to disable Brotli compression.\n\n- `verbose: boolean`  \n  Log compressed files and their compression ratios.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falloc%2Fvite-plugin-compress","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falloc%2Fvite-plugin-compress","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falloc%2Fvite-plugin-compress/lists"}