Experimental CSS class name minifier and Vite plugin (v1.2.0) that shortens CSS class names in both CSS and JavaScript bundles to reduce payload size. It analyzes class usage frequency, assigns shorter names to commonly used classes, and transforms the build output. Currently tested primarily with Vite + React projects. Key differentiator: integrates directly as a Vite plugin, offering class name minification without manual CSS module setup. However, due to its experimental nature, users must carefully configure the exclude option to avoid breaking dynamic class assignments. Requires Node.js >=18 and Vite >=5.0.0.
npm install mimicssNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows how to configure mimicss as a Vite plugin with verbose output and pattern exclusion.
Use the 'exclude' option to prevent minification of classes that are dynamically constructed or used outside the plugin's scope.
Upgrade Vite to version 5.0.0 or later.
Test thoroughly with non-React projects; consider omitting mimicss if false positives occur.
Update Node.js to version 18 or later.
Always import from 'mimicss/vite-plugin'.
Upgrade Vite: npm install vite@latest
Change import statement to: import mimicss from 'mimicss/vite-plugin'
Install mimicss: npm install mimicss