mangle-css-class-webpack-plugin
Advanced tools
Comparing version 4.0.8 to 4.0.9
@@ -5,2 +5,4 @@ # Changelog | ||
### [4.0.9](https://github.com/sndyuk/mangle-css-class-webpack-plugin/compare/v4.0.8...v4.0.9) (2020-02-22) | ||
### [4.0.8](https://github.com/sndyuk/mangle-css-class-webpack-plugin/compare/v4.0.7...v4.0.8) (2020-02-22) | ||
@@ -7,0 +9,0 @@ |
@@ -34,2 +34,9 @@ const chalk = require('./chalk'); | ||
const newClassName = `${acceptPrefix[prefixIndex]}${chars.join('')}` | ||
if (opts.reserveClassName && opts.reserveClassName.includes(newClassName)) { | ||
if (opts.log) { | ||
console.log(`The class name has been reserved. ${chalk.green(newClassName)}`); | ||
} | ||
this.newClassSize++; | ||
return this.generateClassName(original, opts) | ||
} | ||
if (opts.log) { | ||
@@ -36,0 +43,0 @@ console.log(`Minify class name from ${chalk.green(original)} to ${chalk.green(newClassName)}`); |
{ | ||
"name": "mangle-css-class-webpack-plugin", | ||
"version": "4.0.8", | ||
"version": "4.0.9", | ||
"license": "MIT", | ||
@@ -5,0 +5,0 @@ "description": "Minifies and obfuscates the class names in your existing JavaScript, CSS, and HTML without any modern css modules.", |
@@ -50,8 +50,15 @@ [![Build Status](https://travis-ci.org/sndyuk/mangle-css-class-webpack-plugin.svg?branch=master)](https://travis-ci.org/sndyuk/mangle-css-class-webpack-plugin) | ||
If you want to use the back slash '\' on the regexp, use `\\\\\\\\\\\\\\\\` and `\\\\` to match class names contained both JS and CSS. | ||
If you want to use the back slash `\` on the regexp, use `\\\\\\\\\\\\\\\\` and `\\\\` to match class names contained both JS and CSS. | ||
#### reserveClassName | ||
The class names won't be used. | ||
e.g. | ||
```js | ||
reserveClassName: ['fa', 'fas', 'far'], | ||
``` | ||
#### ignorePrefix | ||
The prefix will be ignored from mangling. | ||
e.g. | ||
``` | ||
```js | ||
classNameRegExp: '(abc-|efg-)?[cl]-[a-z][a-zA-Z0-9_]*', | ||
@@ -63,5 +70,5 @@ ignorePrefixRegExp: ['abc-', 'efg-'], | ||
#### ignorePrefixRegExp | ||
Same behavior as ignorePrefix. | ||
Same behavior as ignorePrefix. | ||
e.g. | ||
``` | ||
```js | ||
classNameRegExp: '((hover|focus|xs|md|sm|lg|xl)(\\\\\\\\\\\\\\\\|\\\\)?:)*tw-[a-z_-][a-zA-Z0-9_-]*', | ||
@@ -68,0 +75,0 @@ ignorePrefixRegExp: '((hover|focus|xs|md|sm|lg|xl)(\\\\\\\\\\\\\\\\|\\\\)?:)*', |
11393
170
120