2.3.5 • Published 3 months ago

next-classnames-minifier v2.3.5

Weekly downloads
-
License
MIT
Repository
github
Last release
3 months ago

Next classnames minifier

npm version

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.

After version 3.0.0, the logic for classnames minifying has been moved to a separate package - classnames-minifier.

Important

This description is for >=3.0.0. See instructions for previous versions at next-classnames-minifier/tree/2.3.5

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)

Installation

Using npm:

npm i next-classnames-minifier

Using yarn:

yarn add next-classnames-minifier

Configuration

Options

  • prefix - custom prefix that will be added to each updated class;
  • reservedNames - array of reserved names that should not be used by this package (must include prefix);
  • disabled - disabling classnames minifying;

It is recommended to disable minification for development.

Configuration example:

module.exports = (phase) => withClassnamesMinifier({
  prefix: '_',
  reservedNames: ['_en', '_de'],
  disabled: phase === PHASE_PRODUCTION_SERVER || process.env.NODE_ENV === 'development',
})(nextConfig);

License

MIT

3.0.0-canary.0

3 months ago

2.3.5

3 months ago

2.3.4

3 months ago

2.3.0

4 months ago

2.3.2

4 months ago

2.3.1

4 months ago

2.3.3

4 months ago

2.2.4

4 months ago

2.2.3

4 months ago

2.2.2

4 months ago

2.2.1

4 months ago

2.2.0

4 months ago

2.1.1

4 months ago

2.1.0

4 months ago

2.0.0

4 months ago

1.1.1

8 months ago

1.1.0

8 months ago

1.0.0

8 months ago

1.1.4-canary.0

8 months ago

1.1.3

8 months ago

1.1.2

8 months ago

0.1.2

2 years ago

0.1.1

2 years ago

0.1.0

2 years ago

0.0.3

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago