Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
unematiii committed Oct 22, 2020
1 parent d899255 commit 16eca98
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
11 changes: 6 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const getLocalIdent = getLocalIdentName();
loader: 'css-loader',
options: {
modules: {
getLocalIdent: getLocalIdent,
getLocalIdent,
},
},
},
Expand All @@ -39,7 +39,6 @@ For `css-loader` versions below `3.*`, `modules` options should be specified in

```js
const { getLocalIdentName } = require('css-loader-shorter-classnames');

const getLocalIdent = getLocalIdentName();

// Loader options
Expand All @@ -48,7 +47,7 @@ const getLocalIdent = getLocalIdentName();
loader: 'css-loader',
options: {
modules: true,
getLocalIdent: getLocalIdent,
getLocalIdent,
},
},
```
Expand All @@ -57,6 +56,7 @@ const getLocalIdent = getLocalIdentName();
```js
const { getLocalIdentName } = require('css-loader-shorter-classnames');

const getLocalIdent = getLocalIdentName();
const isProduction = process.env.NODE_ENV === 'production';

// Loader options
Expand All @@ -66,7 +66,7 @@ const isProduction = process.env.NODE_ENV === 'production';
options: {
modules: {
localIdentName: '[local]-[hash:base64:8]',
...(isProduction ? { getLocalIdent: getLocalIdentName() } : {}),
...(isProduction ? { getLocalIdent } : {}),
},
},
},
Expand Down Expand Up @@ -102,6 +102,7 @@ const getLocalIdent = getLocalIdentName(classNameAlphabet, '_', '_');
```js
const { getLocalIdentName } = require('css-loader-shorter-classnames');

const getLocalIdent = getLocalIdentName();
const isProduction = process.env.NODE_ENV === 'production';

module.exports = {
Expand All @@ -112,7 +113,7 @@ module.exports = {
css: {
modules: {
localIdentName: '[local]-[hash:base64:8]',
...(isProduction ? { getLocalIdent: getLocalIdentName() } : {}),
...(isProduction ? { getLocalIdent } : {}),
},
},
},
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "css-loader-shorter-classnames",
"version": "2.0.0",
"version": "2.0.1",
"description": "Provides short class name generator for css-loader with CSS Modules enabled",
"main": "index.js",
"files": [
Expand Down

0 comments on commit 16eca98

Please sign in to comment.