Registry / devops / mimicss

mimicss

JSON →
library1.2.0jsnpmunverified

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 mimicss
INSTALL
IMPORT
SIG · MIMICSS
M
mimicss
devopsjavascriptv1.2.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

default
import mimicss from 'mimicss/vite-plugin'
import mimicss from 'mimicss'
The default export only exists in the vite-plugin subpath; the top-level package does not export anything.
auto
import { defineConfig } from 'vite'
mimicss does not export an auto config; the plugin is named 'mimicss' from the subpath.
Options
import type { Options } from 'mimicss/vite-plugin'
import { Options } from 'mimicss'
TypeScript type is exported only from the vite-plugin subpath.

Shows how to configure mimicss as a Vite plugin with verbose output and pattern exclusion.

import { defineConfig } from 'vite' import mimicss from 'mimicss/vite-plugin' export default defineConfig({ plugins: [ mimicss({ verbose: true, exclude: [/^fi$/, /^fi-/], }), ], })
Debug
Known issues
gotchamimicss is experimental and may break dynamically assigned class names.
fix
Use the 'exclude' option to prevent minification of classes that are dynamically constructed or used outside the plugin's scope.
affects: >=1.0.0
breakingRequires Vite >=5.0.0; older Vite versions not supported.
fix
Upgrade Vite to version 5.0.0 or later.
affects: >=1.0.0
gotchaOnly tested with Vite + React.js. Other frameworks (Vue, Svelte, etc.) may not work correctly.
fix
Test thoroughly with non-React projects; consider omitting mimicss if false positives occur.
affects: >=1.0.0
breakingNode.js >=18 required; breaks on older Node versions.
fix
Update Node.js to version 18 or later.
affects: >=1.0.0
gotchaDefault import from 'mimicss' gives nothing; requires subpath import.
fix
Always import from 'mimicss/vite-plugin'.
affects: >=1.0.0
Errors
Common errors & fixes
Error: The plugin 'mimicss' requires Vite >=5.0.0
Installed Vite version is below 5.0.0.
fix
Upgrade Vite: npm install vite@latest
TypeError: mimicss is not a function
Imported from 'mimicss' instead of 'mimicss/vite-plugin'.
fix
Change import statement to: import mimicss from 'mimicss/vite-plugin'
Module not found: Can't resolve 'mimicss/vite-plugin'
Package mimicss is not installed or version is too old (pre-1.0.0).
fix
Install mimicss: npm install mimicss
Upgrade
Version history
1.2.0latest on npm
Audit
Dependencies
viterequiredpeer dependency required for the Vite plugin to function
Agent activity
3 hits · last 30 days
node
2
Amazon
1
Resources
mimicss — npm install mimicss · libregistry