Skip to content
This repository has been archived by the owner on Jan 21, 2024. It is now read-only.

Commit

Permalink
Merge f78d31c into fbf7a4e
Browse files Browse the repository at this point in the history
  • Loading branch information
fstanis committed Dec 27, 2018
2 parents fbf7a4e + f78d31c commit 627afd9
Showing 1 changed file with 8 additions and 4 deletions.
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

0 comments on commit 627afd9

Please sign in to comment.