{"id":21412870,"url":"https://github.com/hunghg255/vite-minify-css-module","last_synced_at":"2025-07-14T02:32:36.563Z","repository":{"id":214452137,"uuid":"714229580","full_name":"hunghg255/vite-minify-css-module","owner":"hunghg255","description":"Vite plugin minify css module class","archived":false,"fork":false,"pushed_at":"2024-08-05T11:39:04.000Z","size":948,"stargazers_count":9,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-07T23:01:37.183Z","etag":null,"topics":["clean-css","minify-css","plugin","vite"],"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/hunghg255.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},"funding":{"github":["hunghg255"]}},"created_at":"2023-11-04T09:46:38.000Z","updated_at":"2024-10-07T02:24:22.000Z","dependencies_parsed_at":"2024-05-03T12:43:56.441Z","dependency_job_id":"298c7f49-d3e8-4685-acbc-bde4de78c292","html_url":"https://github.com/hunghg255/vite-minify-css-module","commit_stats":null,"previous_names":["hunghg255/vite-minify-css-module"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/hunghg255/vite-minify-css-module","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hunghg255%2Fvite-minify-css-module","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hunghg255%2Fvite-minify-css-module/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hunghg255%2Fvite-minify-css-module/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hunghg255%2Fvite-minify-css-module/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hunghg255","download_url":"https://codeload.github.com/hunghg255/vite-minify-css-module/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hunghg255%2Fvite-minify-css-module/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265233753,"owners_count":23731825,"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":["clean-css","minify-css","plugin","vite"],"created_at":"2024-11-22T18:16:03.250Z","updated_at":"2025-07-14T02:32:35.989Z","avatar_url":"https://github.com/hunghg255.png","language":"TypeScript","funding_links":["https://github.com/sponsors/hunghg255"],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\r\n\u003ca href=\"https://www.npmjs.com/package/vite-minify-css-module\" target=\"_blank\" rel=\"noopener noreferrer\"\u003e\r\n\u003cimg src=\"https://api.iconify.design/bi:plugin.svg?color=%23a985ff\" alt=\"logo\" width='100'/\u003e\u003c/a\u003e\r\n\u003c/p\u003e\r\n\r\n\u003cp align=\"center\"\u003e\r\n  A plugin minify css module for \u003ca href=\"https://vitejs.dev/\" target=\"_blank\" rel=\"noopener noreferrer\"\u003eVitejs\u003c/a\u003e\r\n\u003c/p\u003e\r\n\r\n\u003cp align=\"center\"\u003e\r\n  \u003ca href=\"https://www.npmjs.com/package/vite-minify-css-module\" target=\"_blank\" rel=\"noopener noreferrer\"\u003e\u003cimg src=\"https://badge.fury.io/js/vite-minify-css-module.svg\" alt=\"NPM Version\" /\u003e\u003c/a\u003e\r\n  \u003ca href=\"https://www.npmjs.com/package/vite-minify-css-module\" target=\"_blank\" rel=\"noopener noreferrer\"\u003e\u003cimg src=\"https://img.shields.io/npm/dt/vite-minify-css-module.svg?logo=npm\" alt=\"NPM Downloads\" /\u003e\u003c/a\u003e\r\n  \u003ca href=\"https://bundlephobia.com/result?p=vite-minify-css-module\" target=\"_blank\" rel=\"noopener noreferrer\"\u003e\u003cimg src=\"https://img.shields.io/bundlephobia/minzip/vite-minify-css-module\" alt=\"Minizip\" /\u003e\u003c/a\u003e\r\n  \u003ca href=\"https://github.com/hunghg255/vite-minify-css-module/graphs/contributors\" target=\"_blank\" rel=\"noopener noreferrer\"\u003e\u003cimg src=\"https://img.shields.io/badge/all_contributors-1-orange.svg\" alt=\"Contributors\" /\u003e\u003c/a\u003e\r\n  \u003ca href=\"https://github.com/hunghg255/vite-minify-css-module/blob/main/LICENSE\" target=\"_blank\" rel=\"noopener noreferrer\"\u003e\u003cimg src=\"https://badgen.net/github/license/hunghg255/vite-minify-css-module\" alt=\"License\" /\u003e\u003c/a\u003e\r\n\u003c/p\u003e\r\n\r\n## 🌈 Features\r\n\r\n- 🍰 Minify css module class name\r\n- 🍰 Support clean-css options\r\n\r\n## 📦 Installation\r\n\r\n```bash\r\nnpm i vite-minify-css-module@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 react from '@vitejs/plugin-react';\r\nimport MinifyCssModule from 'vite-minify-css-module/vite';\r\n\r\n// https://vitejs.dev/config/\r\nexport default defineConfig({\r\n  plugins: [\r\n    react(),\r\n    MinifyCssModule({\r\n      cleanCSS: {\r\n        level: {\r\n          2: {\r\n            mergeSemantically: true,\r\n            restructureRules: true,\r\n          },\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\n```typescript\r\nexport interface PluginOptions {\r\n  dictionary?: string;\r\n  clearnCSS?: OptionsOutput;\r\n}\r\n```\r\n\r\n## How does it work?\r\n\r\nBy default, when using css modules, you end up with hashes or other long class-names in your bundled css files:\r\n\r\n```css\r\n@keyframes _close-card_pzatx_1 {\r\n  /* CSS HERE */\r\n}\r\n\r\n._card_pzatx_32 {\r\n  /* CSS HERE */\r\n}\r\n\r\n._back_pzatx_49 ._content_pzatx_70 ._close_pzatx_74 {\r\n  /* CSS HERE */\r\n}\r\n```\r\n\r\nBy using this module, the smallest possible classname will be used for each \"id\":\r\n\r\n```css\r\n@keyframes a {\r\n  /* CSS HERE */\r\n}\r\n\r\n.v {\r\n  /* CSS HERE */\r\n}\r\n\r\n.c .s .w {\r\n  /* CSS HERE */\r\n}\r\n```\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhunghg255%2Fvite-minify-css-module","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhunghg255%2Fvite-minify-css-module","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhunghg255%2Fvite-minify-css-module/lists"}