-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
NCM-2 update readme and package description
- Loading branch information
Showing
3 changed files
with
61 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,45 @@ | ||
# Next classnames minifier | ||
# Next classnames minifier | ||
|
||
Library for configuring style _(css/scss/sass)_ modules to generate compressed classes | ||
|
||
## 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](https://web.dev/first-contentful-paint/)) | ||
|
||
## Installation | ||
|
||
**Using npm:** | ||
```bash | ||
npm i next-classnames-minifier | ||
``` | ||
|
||
**Using yarn:** | ||
```bash | ||
yarn add next-classnames-minifier | ||
``` | ||
|
||
## Usage | ||
|
||
Create `next.config.js` file in your project and apply the library. | ||
|
||
**Base:** | ||
```js | ||
const withClassnamesMinifier = require('next-classnames-minifier').default; | ||
|
||
module.exports = withClassnamesMinifier({ | ||
// next.js config | ||
}); | ||
``` | ||
|
||
**With `next-compose-plugins`:** | ||
```js | ||
const withClassnamesMinifier = require('next-classnames-minifier').default; | ||
const withPlugins = require('next-compose-plugins'); | ||
|
||
module.exports = withPlugins([ | ||
[withClassnamesMinifier] | ||
], nextConfig); | ||
``` | ||
|
||
## License | ||
|
||
[MIT](https://github.com/vordgi/next-classnames-minifier/blob/main/LICENSE) |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters