classnames-minifier
Introduction

@nimpl/classnames-minifier

(Former next-classnames-minifier)

Library for configuring style (css/scss/sass) modules to generate compressed classes (.header -> .a, .nav -> .b, …, .footer -> .aad, etc.) with support for changes and rebuilding without clearing the built application. The package itself synchronizes minified classnames with components of the application compiled earlier.

Installation

Using npm:

npm i @nimpl/classnames-minifier

Reasons

Compressing classes can reduce the size of the generated html and css by up to 20%, which will have a positive effect on page rendering and metrics (primarily FCP)

Working with cache

Next.js has a very complex caching system. It caches processed files and doesn’t rebuild them during next builds, but takes them from the cache.

However, when the package config changes - all these files need to be rebuilt. Without this, there will be critically many artifacts at the intersection of names or unexpected use of previous names.

For this reason, with critical changes in the package configuration, the entire application data will be deleted.

Additional

Please consider giving a star if you like it, it shows that the package is useful and helps continue work on this and other packages.

Create tasks with wishes, ideas, difficulties, etc. All of them will definitely be considered and thought over.