{"id":15292633,"url":"https://github.com/kiosion/vite-plugin-class-mangler","last_synced_at":"2025-10-07T04:32:36.127Z","repository":{"id":50713037,"uuid":"518295692","full_name":"kiosion/vite-plugin-class-mangler","owner":"kiosion","description":"Vite plugin for minifying / obfuscating CSS classes in production builds","archived":true,"fork":false,"pushed_at":"2022-10-02T20:33:28.000Z","size":640,"stargazers_count":31,"open_issues_count":2,"forks_count":3,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-01-15T11:38:40.734Z","etag":null,"topics":["react","svelte","sveltekit","vite","vite-plugin","vitejs","vue"],"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/kiosion.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-07-27T03:28:01.000Z","updated_at":"2024-08-01T13:59:49.000Z","dependencies_parsed_at":"2023-01-19T02:30:33.082Z","dependency_job_id":null,"html_url":"https://github.com/kiosion/vite-plugin-class-mangler","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kiosion%2Fvite-plugin-class-mangler","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kiosion%2Fvite-plugin-class-mangler/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kiosion%2Fvite-plugin-class-mangler/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kiosion%2Fvite-plugin-class-mangler/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kiosion","download_url":"https://codeload.github.com/kiosion/vite-plugin-class-mangler/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":235593342,"owners_count":19015137,"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":["react","svelte","sveltekit","vite","vite-plugin","vitejs","vue"],"created_at":"2024-09-30T16:20:07.044Z","updated_at":"2025-10-07T04:32:30.747Z","avatar_url":"https://github.com/kiosion.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align='center'\u003e\n  \u003ch1\u003evite-plugin-class-mangler\u003c/h1\u003e\n  \u003cp\u003eVite plugin for minifying / obfuscating classes in production builds. Compatible with Tailwind, inline, or imported styles.\u003c/p\u003e\n  \u003cimg width=\"948\" alt=\"Before/after\" src=\"https://user-images.githubusercontent.com/34040324/182059296-031701cf-da83-4b34-a232-9e9b52c97b56.png\"\u003e\n\u003c/div\u003e\n\n## Supported frameworks\n\n- Vue (In progress)\n- React (In progress)\n- Svelte\n\n## Installation\n\n\u003e This plugin is still a work-in-progress, I'm currently working out how to extract used classes from templates \u0026 scripts before bundling, and replace all references within style tags, css, and scss files after parsing - The 'buildEnd' hook would be good timeline-wise, but doesn't allow for modification of the code. If you're knowledgable with the Vite/Rollup plugin APIs, contributions would be appreciated!\n\n## Usage\n\nAdd to your vite config:\n\n```js\nimport { defineConfig } from 'vite';\nimport ClassMangler from 'vite-plugin-class-mangler';\n\nexport default defineConfig({\n  plugins: [\n    ClassMangler()\n  ]\n});\n```\n\nOptionally, customize any of the following options:\n\n```js\nClassMangler({\n  dev: true,\n  min: 2,\n  max: 6,\n  length: 8,\n  suffixes: ['.svelte', '.html']\n})\n```\n\n'Dev' determines whether to apply the plugin on serve or build. It defaults to 'false', only replacing class names in production builds.\n\nMin / max are inclusive integers used for randomizing the length of the generated classes. If 'length' is provided instead, these will be ignored.\n\nSuffixes can be overriden, provided as an array of strings, although the defaults should work in most cases (['.svelte', '.tsx', '.jsx', '.html', '.vue']).\n\n## Testing\n\nRun unit tests:\n\n```bash\nyarn test\n```\n\n## Credits\n\nForked from [vite-plugin-tailwind-obfuscate](https://github.com/misbahansori/vite-plugin-tailwind-obfuscate)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkiosion%2Fvite-plugin-class-mangler","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkiosion%2Fvite-plugin-class-mangler","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkiosion%2Fvite-plugin-class-mangler/lists"}