Registry / devops / rs-next-classnames-minifier

rs-next-classnames-minifier

JSON →
library0.1.6jsnpmunverified

@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-minifier
INSTALL
IMPORT
SIG · RS-NEXT-CLASSNAMES
R
rs-next-classnames-minifier
devopsjavascriptv0.1.6
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.

withClassnamesMinifier
import { withClassnamesMinifier } from '@nimpl/classnames-minifier'
const withClassnamesMinifier = require('@nimpl/classnames-minifier')
The package is ESM-only. CommonJS require will not work.
classnamesMinifier
import { classnamesMinifier } from '@nimpl/classnames-minifier'
Named export for lower-level configuration.

Shows basic setup in next.config.js to enable class name minification.

// next.config.js const { withClassnamesMinifier } = require('@nimpl/classnames-minifier'); /** @type {import('next').NextConfig} */ const nextConfig = { sassOptions: { includePaths: ['./styles'], }, }; module.exports = withClassnamesMinifier(nextConfig);
Debug
Known issues
breakingRequires css-loader >=4.0.0. Older versions are incompatible.
fix
Update css-loader to version >=4.0.0.
affects: <0.1.0
gotchaWhen using Turbopack (--turbo), minification may not work as expected.
fix
Fall back to webpack until Turbopack support is confirmed stable.
affects: >=0.1.0
gotchaDo not manually clear .next directory between builds; the plugin maintains a mapping file there.
fix
Let the plugin manage the cache. If manually clearing, rebuild must start fresh.
affects: >=0.1.0
breakingThe package is ESM-only. CommonJS require fails.
fix
Use import syntax or ensure your project uses ESM.
affects: >=0.1.0
Errors
Common errors & fixes
Cannot find module '@nimpl/classnames-minifier'
Package not installed or ESM resolution issues.
fix
Run npm install @nimpl/classnames-minifier and ensure you are using ESM (type: module in package.json or .mjs extension).
TypeError: classnamesMinifier is not a function
Incorrect import (default vs named) or CJS fallback.
fix
Use import { withClassnamesMinifier } from '@nimpl/classnames-minifier'.
Upgrade
Version history
0.1.6latest on npm
Audit
Dependencies
css-loaderrequiredPeer dependency for CSS module processing
Agent activity
6 hits · last 30 days
node
6
Resources
rs-next-classnames-minifier — npm install rs-next-classnames-minifier · libregistry