{"id":13417340,"url":"https://github.com/unplugin/unplugin-imagemin","last_synced_at":"2025-06-21T03:10:04.326Z","repository":{"id":63572697,"uuid":"567155983","full_name":"unplugin/unplugin-imagemin","owner":"unplugin","description":"📦 Compression Image compression plugin based on squoosh-next","archived":false,"fork":false,"pushed_at":"2025-06-09T16:33:36.000Z","size":113481,"stargazers_count":235,"open_issues_count":15,"forks_count":20,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-14T17:03:32.343Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/unplugin.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":null,"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,"zenodo":null},"funding":{"github":"unplugin"}},"created_at":"2022-11-17T07:29:13.000Z","updated_at":"2025-06-10T16:16:39.000Z","dependencies_parsed_at":"2023-09-03T07:50:38.726Z","dependency_job_id":"b0ea1dcb-e3e4-4e76-903a-4763eddfe7be","html_url":"https://github.com/unplugin/unplugin-imagemin","commit_stats":null,"previous_names":["erkelost/unplugin-imagemin"],"tags_count":86,"template":false,"template_full_name":null,"purl":"pkg:github/unplugin/unplugin-imagemin","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unplugin%2Funplugin-imagemin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unplugin%2Funplugin-imagemin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unplugin%2Funplugin-imagemin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unplugin%2Funplugin-imagemin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/unplugin","download_url":"https://codeload.github.com/unplugin/unplugin-imagemin/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unplugin%2Funplugin-imagemin/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261055382,"owners_count":23103227,"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":[],"created_at":"2024-07-30T22:00:35.533Z","updated_at":"2025-06-21T03:09:59.039Z","avatar_url":"https://github.com/unplugin.png","language":"TypeScript","readme":"# 📦📦 unplugin Imagemin Picture compression\r\n\r\n[![NPM version](https://img.shields.io/npm/v/unplugin-imagemin?color=a1b858\u0026label=)](https://www.npmjs.com/package/unplugin-imagemin)\r\n\r\n\u003e [!IMPORTANT]\r\n\u003e **Tips:**\r\n\u003e `1.0 goals` unplugin-imagemin is preparing to release version 1.0, which will be released after achieving the following goals\r\n\r\n- [x] Support all node versions by re-modifying the wasm syntax of squoosh\r\n- [x] remove sharp deps\r\n- [x] support compress publicDir images\r\n- [x] support css compress image\r\n- [x] Supports full cache mode\r\n- [x] Support Node 22 and more\r\n- [x] Type options\r\n- [ ] Supports farm, rsbuild, webpack, and other frameworks\r\n\r\n\u003e [!WARNING]\r\nNew features and stability, compatibility and performance features are constantly being updated\r\nRecommended to use the latest version  `pnpm add unplugin-imagemin@latest -D`\r\n\r\n\u003e [!WARNING]\r\nSince Google [squoosh](https://github.com/GoogleChromeLabs/squoosh) no longer maintains the node direction, This fock came out and revised some compatibility issues. Details [squoosh-next](https://github.com/ErKeLost/squoosh-node-latest)\r\n\r\n### ✨✨ Continuous iterative development in testing\r\n\r\n```bash\r\n✨ : unplugin-imagemin\r\n✔ : Process start with mode squoosh\r\n✅ : [test1.png] [12.39 MB] -\u003e [102.54 KB]\r\n✔ : Process start with mode squoosh\r\n✅ : [test2.png] [16.38 MB] -\u003e [76.79 KB]\r\n```\r\n\r\n#### 🌈 Features\r\n\r\n- 🍰 Support png jpeg webp avif svg tiff Format\r\n- 🦾 High Performance based on squoosh\r\n- ✨ Multiple picture formats can be configured\r\n- 🪐 Compress the code at build time\r\n- 😃 Caching Mechanism\r\n- 🌈 You can convert different picture types at build time\r\n\r\n## Squoosh \u0026\u0026 Svgo\r\n\r\nUnplugin-imagemin supports two compression tools\r\n\r\n[Squoosh](https://github.com/GoogleChromeLabs/squoosh) is an image compression web app that reduces image sizes through numerous formats.\r\n**Squoosh** with rust \u0026 wasm\r\n\r\n[Svgo](https://github.com/svg/svgo) Support compression of pictures in svg format\r\n\r\n## 📦 Installation\r\n\r\n```bash\r\npnpm add unplugin-imagemin@latest -D\r\n```\r\n\r\n#### support vite and rollup\r\n\r\n\u003cdetails\u003e\r\n\u003csummary\u003eBasic\u003c/summary\u003e\u003cbr\u003e\r\n\r\n```ts\r\nimport { defineConfig } from 'vite';\r\nimport vue from '@vitejs/plugin-vue';\r\nimport imagemin from 'unplugin-imagemin/vite';\r\n// https://vitejs.dev/config/\r\nexport default defineConfig({\r\n  plugins: [vue(), imagemin()],\r\n});\r\n```\r\n\r\n\u003cbr\u003e\u003c/details\u003e\r\n\r\n\u003cdetails\u003e\r\n\u003csummary\u003eAdvanced\u003c/summary\u003e\u003cbr\u003e\r\n\r\n```ts\r\niimport { defineConfig } from 'vite';\r\nimport vue from '@vitejs/plugin-vue';\r\nimport imagemin from 'unplugin-imagemin/vite';\r\n// https://vitejs.dev/config/\r\nexport default defineConfig({\r\n  plugins: [\r\n    vue(),\r\n    imagemin({\r\n      // default true\r\n      cache: false,\r\n      // Default configuration options for compressing different pictures\r\n      compress: {\r\n        jpg: {\r\n          quality: 10,\r\n        },\r\n        jpeg: {\r\n          quality: 10,\r\n        },\r\n        png: {\r\n          quality: 10,\r\n        },\r\n        webp: {\r\n          quality: 10,\r\n        },\r\n      },\r\n      conversion: [\r\n        { from: 'jpeg', to: 'webp' },\r\n        { from: 'png', to: 'webp' },\r\n        { from: 'JPG', to: 'jpeg' },\r\n      ],\r\n    }),\r\n  ],\r\n});\r\n\r\n```\r\n\r\n\u003cbr\u003e\u003c/details\u003e\r\n\r\n## 🌸 DefaultConfiguration\r\n\r\nSquoosh DefaultConfiguration\r\n\r\nDefaultConfiguration see [DefaultConfiguration](https://github.com/ErKeLost/unplugin-imagemin/blob/main/src/core/compressOptions.ts)\r\n\r\nPlugin property configuration see [configuration](https://github.com/ErKeLost/unplugin-imagemin/blob/main/src/core/types/index.ts)\r\n\r\n```typescript\r\nexport interface PluginOptions {\r\n  /**\r\n   * @description Picture compilation and conversion\r\n   * @default []\r\n   */\r\n  conversion?: ConversionItemType[];\r\n  /**\r\n   * @description Whether to turn on caching\r\n   * @default true\r\n   */\r\n  cache?: boolean;\r\n  /**\r\n   * @description Path to the cache file location\r\n   * @default ./node_modules/.cache/unplugin-imagemin/.unplugin-imagemin-cache\r\n   */\r\n  cacheLocation?: string;\r\n  /**\r\n   * @description Compilation attribute\r\n   * @default CompressTypeOptions\r\n   */\r\n  compress?: CompressTypeOptions;\r\n}\r\n```\r\n","funding_links":["https://github.com/sponsors/unplugin"],"categories":["Plugins","TypeScript"],"sub_categories":["Framework-agnostic Plugins"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Funplugin%2Funplugin-imagemin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Funplugin%2Funplugin-imagemin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Funplugin%2Funplugin-imagemin/lists"}