Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
unematiii committed Sep 30, 2020
1 parent 504a98f commit e432822
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
12 changes: 4 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ npm i css-loader-shorter-classnames -D

## Basic usage

```
```js
// Import class name generator factory
const { getLocalIdentName } = require('css-loader-shorter-classnames');

Expand All @@ -35,7 +35,7 @@ const getLocalIdent = getLocalIdentName();
```

## Enable only for production
```
```js
const { getLocalIdentName } = require('css-loader-shorter-classnames');

const isProduction = process.env.NODE_ENV === 'production';
Expand All @@ -56,13 +56,9 @@ const isProduction = process.env.NODE_ENV === 'production';
## Custom alphabet, prefix and suffix
Optionally supply a custom alphabet and/or prefix and/or suffix.

```
const generator = (alphabet? = defaultAlphabet, prefix?: string, suffix?: string) => string;
```

NB! Watch out for spaces and other invalid characters. If alphabet contains numbers, class names that would otherwise start with a number, will be automatically prefixed with `_` (eg `0` --> `_0`)). That is, unless you supply a prefix that doesn't start with a number yourself.

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

// Produces: 'a', 'b', 'c', 'aa', 'ab', ... 'abcabca' etc.
Expand All @@ -85,7 +81,7 @@ const getLocalIdent = getLocalIdentName(classNamesAlphabet, '_', '_');

`vue.config.js`:

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

const isProduction = process.env.NODE_ENV === 'production';
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": "1.0.2",
"version": "1.0.4",
"description": "Provides short class name generator for css-loader with CSS Modules enabled",
"main": "index.js",
"files": [
Expand Down

0 comments on commit e432822

Please sign in to comment.