Skip to content
This repository was archived by the owner on Jan 21, 2024. It is now read-only.
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,21 @@ npm install posthtml-uglify --save
## Usage

```js
var posthtml = require('posthtml');
var uglify = require('posthtml-uglify');
const posthtml = require('posthtml');
const uglify = require('posthtml-uglify');

posthtml()
.use(uglify({ whitelist: '.bar' }))
.use(uglify({ whitelist: ['.bar'] }))
.process('<style>#foo { color: red } .bar { color: blue }</style><div id="foo" class="bar">baz</div>')
.then(function(result) {
.then((result) => {
console.log(result.html); //=> '<style>#xz { color: red } .bar { color: blue }</style><div id="xz" class="bar">baz</div>'
});
```

### Options

- **whitelist** (Array): list of selectors that should not be rewritten by this plugin. For example, an id or class that is used by JavaScript code.

## Contributing

1. Fork it
Expand Down