pc__replace_class_in_html
v0.0.1
Published
This is plugin for nmp-package "Post-Compression". He`s searching and replaces long class names on short class names, in the HTML code.
Downloads
2
Maintainers
Readme
Replace class names in HTML
This is plugin for nmp-package "Post-Compression".
He`s searching and replaces long class names on short class names, in the HTML code.
An example of using:
var replaceClassNameInHTML = require("pc__replace_class_in_html");
gulp.src("./*.html")
replaceClassNameInHTML()
], shortNames));
Where:
- shortNames - an object of type JSON with rules replace the long words to short words.
An example of the JSON object "shortNames":
{
"class_in_html": { // the name of the group names
"someIdA": "a", // long name: short name
"someIdB": "b"
}
}
An example of HTML code before:
<p class="someClassA"></p>
<p class="someClassA someClassB"></p>
An example of HTML code after:
<p class="a"></p>
<p class="a b"></p>