@nimpl/classnames-minifier (v0.1.6) is a Next.js plugin that compresses CSS module class names (e.g., .header → .a) with persistent mappings across rebuilds without clearing the build cache. It integrates with css-loader >=4.0.0, supports CSS/SCSS/Sass modules, and works with both webpack and Turbopack. Unlike alternatives that require clearing cache on changes, it maintains synchronization between minified names and compiled components. Ships TypeScript types, actively maintained.
npm install rs-next-classnames-minifierNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows basic setup in next.config.js to enable class name minification.
Update css-loader to version >=4.0.0.
Fall back to webpack until Turbopack support is confirmed stable.
Let the plugin manage the cache. If manually clearing, rebuild must start fresh.
Use import syntax or ensure your project uses ESM.
Run npm install @nimpl/classnames-minifier and ensure you are using ESM (type: module in package.json or .mjs extension).
Use import { withClassnamesMinifier } from '@nimpl/classnames-minifier'.