Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/kenmueller/next-optimized-classnames

Reduce all CSS classes produced by CSS modules to the smallest form possible
https://github.com/kenmueller/next-optimized-classnames

Last synced: about 2 months ago
JSON representation

Reduce all CSS classes produced by CSS modules to the smallest form possible

Awesome Lists containing this project

README

        

# next-optimized-classnames

> Reduce all CSS classes produced by CSS modules to the smallest form possible

**Classes are only optimized in production builds**

Works with SASS/SCSS/CSS modules

## Install

```bash
npm i next-optimized-classnames
```

## Use

### Standalone

```js
// next.config.js

module.exports = require('next-optimized-classnames')()
```

### With custom configuration

```js
// next.config.js

module.exports = require('next-optimized-classnames')({
// Custom config
})
```

### With other plugins

```js
// next.config.js

module.exports = require('next-compose-plugins')(
[
[require('next-optimized-classnames')]
// Other plugins
],
{
// Your config
}
)
```

## Example

### Without `next-optimized-classnames`

```html


My website


This is the BEST website ever!



```

### With `next-optimized-classnames`

```html


My website


This is the BEST website ever!



```