{"id":13417317,"url":"https://github.com/nonzzz/vite-plugin-compression","last_synced_at":"2025-04-05T05:05:36.278Z","repository":{"id":47608607,"uuid":"454016981","full_name":"nonzzz/vite-plugin-compression","owner":"nonzzz","description":"vite plugin. compress your bundle file.","archived":false,"fork":false,"pushed_at":"2024-04-18T08:53:31.000Z","size":2953,"stargazers_count":122,"open_issues_count":0,"forks_count":7,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-05-02T02:53:03.656Z","etag":null,"topics":["compression","vite-compression","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/nonzzz.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":"2022-01-31T13:28:18.000Z","updated_at":"2024-08-14T08:00:12.474Z","dependencies_parsed_at":"2024-03-02T21:24:24.097Z","dependency_job_id":"00a14c44-c451-4d71-870d-7494469fc7e4","html_url":"https://github.com/nonzzz/vite-plugin-compression","commit_stats":null,"previous_names":["nonzzz/vite-plugin-compression","nonzzz/vite-compression-plugin","xeryyue/vite-compression-plugin"],"tags_count":43,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nonzzz%2Fvite-plugin-compression","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nonzzz%2Fvite-plugin-compression/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nonzzz%2Fvite-plugin-compression/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nonzzz%2Fvite-plugin-compression/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nonzzz","download_url":"https://codeload.github.com/nonzzz/vite-plugin-compression/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247289426,"owners_count":20914464,"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":["compression","vite-compression","vite-plugin"],"created_at":"2024-07-30T22:00:35.273Z","updated_at":"2025-04-05T05:05:36.268Z","avatar_url":"https://github.com/nonzzz.png","language":"TypeScript","readme":"\u003cp align=\"center\"\u003e\n\u003cimg src=\"https://socialify.git.ci/nonzzz/vite-plugin-compression/image?description=1\u0026font=KoHo\u0026language=1\u0026logo=https%3A%2F%2Favatars.githubusercontent.com%2Fu%2F65625612%3Fs%3D200%26v%3D4\u0026name=1\u0026owner=1\u0026pattern=Solid\u0026theme=Auto\" width=\"640\" height=\"320\" /\u003e\n\u003c/p\u003e\n\n[![codecov](https://codecov.io/gh/nonzzz/vite-plugin-compression/branch/master/graph/badge.svg?token=NG4475OP6B)](https://codecov.io/gh/nonzzz/vite-compression-plugin)\n\n## Install\n\n```bash\n$ yarn add vite-plugin-compression2 -D\n\n# or\n\n$ npm install vite-plugin-compression2 -D\n```\n\n## Usage\n\n```js\nimport { defineConfig } from 'vite'\n\nimport { compression } from 'vite-plugin-compression2'\n\nexport default defineConfig({\n  plugins: [\n    // ...your plugin\n    compression()\n    // If you want to create a tarball archive you can import tarball plugin from this package and use\n    // after compression.\n  ]\n})\n```\n\n## Options\n\n| params                 | type                                          | default                                                      | description                                                                                |\n| ---------------------- | --------------------------------------------- | ------------------------------------------------------------ | ------------------------------------------------------------------------------------------ |\n| `include`              | `string \\| RegExp \\| Array\u003cstring \\| RegExp\u003e` | `/\\.(html\\|xml\\|css\\|json\\|js\\|mjs\\|svg\\|yaml\\|yml\\|toml)$/` | Include all assets matching any of these conditions.                                       |\n| `exclude`              | `string \\| RegExp \\| Array\u003cstring \\| RegExp\u003e` | `-`                                                          | Exclude all assets matching any of these conditions.                                       |\n| `threshold`            | `number`                                      | `0`                                                          | Only assets bigger than this size are processed (in bytes)                                 |\n| `algorithm`            | `string\\| function`                           | `gzip`                                                       | The compression algorithm                                                                  |\n| `compressionOptions`   | `Record\u003cstring,any\u003e`                          | `{}`                                                         | Compression options for `algorithm`(details see `zlib module`)                             |\n| `deleteOriginalAssets` | `boolean`                                     | `false`                                                      | Whether to delete the original assets or not                                               |\n| `skipIfLargerOrEqual`  | `boolean`                                     | `true`                                                       | Whether to skip the compression if the result is larger than or equal to the original file |\n| `filename`             | `string`                                      | `[path][base].gz`                                            | The target asset filename                                                                  |\n\n## Q \u0026 A\n\n[FAQ](./Q\u0026A.md)\n\n### Others\n\n- If you want to analysis your bundle assets. Maybe you can try [vite-bundle-analyzer](https://github.com/nonzzz/vite-bundle-analyzer)\n\n- `tarball` option `dest` means to generate a tarball somewhere\n\n- `tarball` is based on the `ustar`. It should be compatible with all popular tar distributions out there (gnutar, bsdtar etc)\n\n### Sponsors\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://cdn.jsdelivr.net/gh/nonzzz/sponsors/sponsorkit/sponsors.svg\"\u003e\n    \u003cimg src=\"https://cdn.jsdelivr.net/gh/nonzzz/sponsors/sponsorkit/sponsors.svg\"/\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\n### LICENSE\n\n[MIT](./LICENSE)\n\n## Acknowledgements\n\n[NWYLZW](https://github.com/NWYLZW)\n\n### Author\n\n[Kanno](https://github.com/nonzzz)\n","funding_links":[],"categories":["Plugins"],"sub_categories":["Framework-agnostic Plugins"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnonzzz%2Fvite-plugin-compression","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnonzzz%2Fvite-plugin-compression","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnonzzz%2Fvite-plugin-compression/lists"}