{"id":16184167,"url":"https://github.com/mini-ghost/vite-plugin-clean-css","last_synced_at":"2025-03-19T02:31:05.879Z","repository":{"id":211153561,"uuid":"728367094","full_name":"Mini-ghost/vite-plugin-clean-css","owner":"Mini-ghost","description":"Optimize CSS for production using clean-css","archived":false,"fork":false,"pushed_at":"2023-12-11T10:52:00.000Z","size":92,"stargazers_count":23,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-17T01:51:13.918Z","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/Mini-ghost.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-12-06T19:40:31.000Z","updated_at":"2025-03-13T18:41:27.000Z","dependencies_parsed_at":"2024-10-27T19:24:53.790Z","dependency_job_id":"ea0fcb96-cc28-43a7-8d89-2b8a99dd9cef","html_url":"https://github.com/Mini-ghost/vite-plugin-clean-css","commit_stats":{"total_commits":7,"total_committers":1,"mean_commits":7.0,"dds":0.0,"last_synced_commit":"2d6e5ab7c5879fe7486d590cf93fc6befe35ecdc"},"previous_names":["mini-ghost/vite-plugin-clean-css"],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mini-ghost%2Fvite-plugin-clean-css","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mini-ghost%2Fvite-plugin-clean-css/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mini-ghost%2Fvite-plugin-clean-css/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mini-ghost%2Fvite-plugin-clean-css/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Mini-ghost","download_url":"https://codeload.github.com/Mini-ghost/vite-plugin-clean-css/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244341479,"owners_count":20437658,"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-10-10T07:09:13.344Z","updated_at":"2025-03-19T02:31:05.596Z","avatar_url":"https://github.com/Mini-ghost.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# vite-plugin-clean-css\n\n[![NPM version](https://img.shields.io/npm/v/vite-plugin-clean-css?color=34A88C\u0026label=)](https://www.npmjs.com/package/vite-plugin-clean-css)\n\nOptimize CSS for production using [clean-css](https://github.com/clean-css/clean-css)\n\n## Usage\n\nThis plugin minimizes CSS during production. It will minify CSS rules such as:\n\n```css\n/* 832 bytes */\n.translate-x-0 {\n  --un-translate-x: 0;\n  transform: translateX(var(--un-translate-x)) translateY(var(--un-translate-y))\n    translateZ(var(--un-translate-z)) rotate(var(--un-rotate))\n    rotateX(var(--un-rotate-x)) rotateY(var(--un-rotate-y))\n    rotateZ(var(--un-rotate-z)) skewX(var(--un-skew-x)) skewY(var(--un-skew-y))\n    scaleX(var(--un-scale-x)) scaleY(var(--un-scale-y))\n    scaleZ(var(--un-scale-z));\n}\n.translate-x-1 {\n  --un-translate-x: 0.25rem;\n  transform: translateX(var(--un-translate-x)) translateY(var(--un-translate-y))\n    translateZ(var(--un-translate-z)) rotate(var(--un-rotate))\n    rotateX(var(--un-rotate-x)) rotateY(var(--un-rotate-y))\n    rotateZ(var(--un-rotate-z)) skewX(var(--un-skew-x)) skewY(var(--un-skew-y))\n    scaleX(var(--un-scale-x)) scaleY(var(--un-scale-y))\n    scaleZ(var(--un-scale-z));\n}\n```\n\nWill be minimized to:\n\n```css\n/* \n CleanCss({\n  level: {\n   2: {\n    mergeSemantically: true,\n    restructureRules: true,\n   },\n  },\n }),\n*/\n\n/* 493 bytes */\n.translate-x-0,\n.translate-x-1 {\n  transform: translate(var(--un-translate-x)) translateY(var(--un-translate-y))\n    translateZ(var(--un-translate-z)) rotate(var(--un-rotate))\n    rotateX(var(--un-rotate-x)) rotateY(var(--un-rotate-y))\n    rotate(var(--un-rotate-z)) skew(var(--un-skew-x)) skewY(var(--un-skew-y))\n    scaleX(var(--un-scale-x)) scaleY(var(--un-scale-y))\n    scaleZ(var(--un-scale-z));\n}\n.translate-x-0 {\n  --un-translate-x: 0;\n}\n.translate-x-1 {\n  --un-translate-x: 0.25rem;\n}\n```\n\n\u003e [!NOTE]\n\u003e Using `mergeSemantically` may potentially affect CSS specificity.\n\u003e Please consider its usage carefully.\n\n## Installation\n\n```bash\nnpm install -D vite-plugin-clean-css\n```\n\n## Setup\n  \n```ts\n// vite.config.ts\n\nimport { defineConfig } from 'vite'\nimport CleanCss from 'vite-plugin-clean-css'\n\nexport default defineConfig({\n  plugins: [\n    CleanCss({\n      // Please note that level 1 optimization options are generally safe while level 2 optimizations should be safe for most users.\n      level: 2,\n    }),\n  ],\n})\n```\n\n## License\n\n[MIT License](https://github.com/Mini-ghost/vite-plugin-clean-css/blob/main/LICENSE) © 2023-PRESENT [Alex Liu](https://github.com/Mini-ghost)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmini-ghost%2Fvite-plugin-clean-css","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmini-ghost%2Fvite-plugin-clean-css","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmini-ghost%2Fvite-plugin-clean-css/lists"}