Skip to content

Commit

Permalink
NCM-2 update readme and package description
Browse files Browse the repository at this point in the history
  • Loading branch information
vordgi committed Dec 29, 2021
1 parent b4b92ff commit db71a68
Show file tree
Hide file tree
Showing 3 changed files with 61 additions and 41 deletions.
46 changes: 45 additions & 1 deletion README.md
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)
37 changes: 1 addition & 36 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 15 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,17 +1,28 @@
{
"name": "next-classnames-minifier",
"version": "0.0.1",
"description": "",
"version": "0.0.2",
"description": "Library for configuring style modules to generate compressed classes",
"main": "dist/withClassnamesMinifier.js",
"types": "dist/withClassnamesMinifier.d.ts",
"files": [
"dist"
],
"scripts": {
"start": "ts-node index.ts",
"build": "tsc"
},
"keywords": [],
"keywords": [
"next",
"next.js",
"classname",
"class",
"minify",
"compress",
"cut",
"css",
"sass",
"scss",
"modules"
],
"repository": {
"type": "git",
"url": "git://github.com/vordgi/next-classnames-minifier.git"
Expand Down

0 comments on commit db71a68

Please sign in to comment.