posthtml-uglify
v2.0.0
Published
A PostHTML plugin to rewrite CSS identifiers in HTML
Downloads
11
Maintainers
Readme
posthtml-uglify
A PostHTML plugin to rewrite CSS identifiers in HTML for the purposes of compression and obfuscation.
Installation
npm install posthtml-uglify --save
Usage
var posthtml = require('posthtml');
var uglify = require('posthtml-uglify');
posthtml()
.use(uglify({ whitelist: '.bar' }))
.process('<style>#foo { color: red } .bar { color: blue }</style><div id="foo" class="bar">baz</div>')
.then(function(result) {
console.log(result.html); //=> '<style>#xz { color: red } .bar { color: blue }</style><div id="xz" class="bar">baz</div>'
});
Contributing
- Fork it
- Create your feature branch
- Commit your changes (
git commit -am 'Added some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request
Running tests
npm install
npm test