A PostHTML plugin to rewrite CSS identifiers in HTML for the purposes of compression and obfuscation.
npm install posthtml-uglify --save
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>'
});
- 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
npm install
npm test