{"id":15065655,"url":"https://github.com/vbenjs/vite-plugin-compression","last_synced_at":"2025-12-24T22:14:21.128Z","repository":{"id":37667801,"uuid":"338103592","full_name":"vbenjs/vite-plugin-compression","owner":"vbenjs","description":"Use gzip or brotli to compress resources","archived":false,"fork":false,"pushed_at":"2024-05-20T16:27:51.000Z","size":2999,"stargazers_count":457,"open_issues_count":22,"forks_count":30,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-11-27T12:12:14.436Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/vbenjs.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-02-11T17:40:51.000Z","updated_at":"2025-11-19T12:15:03.000Z","dependencies_parsed_at":"2024-06-18T12:31:03.656Z","dependency_job_id":"4e3f0228-a7da-44a4-adc1-99df9012b788","html_url":"https://github.com/vbenjs/vite-plugin-compression","commit_stats":{"total_commits":35,"total_committers":5,"mean_commits":7.0,"dds":0.4571428571428572,"last_synced_commit":"077eff37f45f12896326d687aa0e08f99b2b7a07"},"previous_names":["anncwb/vite-plugin-compression"],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/vbenjs/vite-plugin-compression","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vbenjs%2Fvite-plugin-compression","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vbenjs%2Fvite-plugin-compression/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vbenjs%2Fvite-plugin-compression/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vbenjs%2Fvite-plugin-compression/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vbenjs","download_url":"https://codeload.github.com/vbenjs/vite-plugin-compression/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vbenjs%2Fvite-plugin-compression/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28010563,"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","status":"online","status_checked_at":"2025-12-24T02:00:07.193Z","response_time":83,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":[],"created_at":"2024-09-25T00:44:22.668Z","updated_at":"2025-12-24T22:14:21.075Z","avatar_url":"https://github.com/vbenjs.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# vite-plugin-compression\n\n**English** | [中文](./README.zh_CN.md)\n\n[![npm][npm-img]][npm-url] [![node][node-img]][node-url]\n\nUse `gzip` or `brotli` to compress resources.\n\nSince [vite-plugin-compress](https://github.com/alloc/vite-plugin-compress) does not support `gzip` compression, a separate copy has been modified and some functions have been added.\n\n## Install (yarn or npm)\n\n**node version:** \u003e=12.0.0\n\n**vite version:** \u003e=2.0.0\n\n```\nyarn add vite-plugin-compression -D\n```\n\nor\n\n```\nnpm i vite-plugin-compression -D\n```\n\n## Usage\n\n- Configuration plugin in vite.config.ts\n\n```ts\nimport viteCompression from 'vite-plugin-compression';\n\nexport default () =\u003e {\n  return {\n    plugins: [viteCompression()],\n  };\n};\n```\n\n### Options\n\n| params | type | default | default |\n| --- | --- | --- | --- |\n| verbose | `boolean` | `true` | Whether to output the compressed result in the console |\n| filter | `RegExp or (file: string) =\u003e boolean` | `DefaultFilter` | Specify which resources are not compressed |\n| disable | `boolean` | `false` | Whether to disable |\n| threshold | `number` | `1025` | It will be compressed if the volume is larger than threshold, the unit is b |\n| algorithm | `string` | `gzip` | Compression algorithm, optional ['gzip','brotliCompress' ,'deflate','deflateRaw'] |\n| ext | `string` | `.gz` | Suffix of the generated compressed package |\n| compressionOptions | `object` | - | The parameters of the corresponding compression algorithm |\n| deleteOriginFile | `boolean` | - | Whether to delete source files after compression |\n\n**DefaultFilter**\n\n`/\\.(js|mjs|json|css|html)$/i`\n\n## Example\n\n**Run Example**\n\n```bash\n\ncd ./example\n\nyarn install\n\nyarn test:gzip\n\nyarn test:br\n\n```\n\n## Sample project\n\n[Vben Admin](https://github.com/anncwb/vue-vben-admin)\n\n## License\n\nMIT\n\n## Inspiration\n\n[vite-plugin-compress](https://github.com/alloc/vite-plugin-compress)\n\n[npm-img]: https://img.shields.io/npm/v/vite-plugin-compression.svg\n[npm-url]: https://npmjs.com/package/vite-plugin-compression\n[node-img]: https://img.shields.io/node/v/vite-plugin-compression.svg\n[node-url]: https://nodejs.org/en/about/releases/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvbenjs%2Fvite-plugin-compression","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvbenjs%2Fvite-plugin-compression","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvbenjs%2Fvite-plugin-compression/lists"}