Skip to content

Commit

Permalink
fix: Update references to html-minifier
Browse files Browse the repository at this point in the history
fix #1311
  • Loading branch information
jantimon committed Nov 11, 2019
1 parent f4eafdc commit 24bf1b5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@ plugins: [
### Minification

If the `minify` option is set to `true` (the default when webpack's `mode` is `'production'`),
the generated HTML will be minified using [html-minifier](https://github.com/kangax/html-minifier)
the generated HTML will be minified using [html-minifier-terser](https://github.com/DanielRuf/html-minifier-terser)
and the following options:

```js
Expand All @@ -337,7 +337,7 @@ and the following options:
}
```

To use custom [html-minifier options](https://github.com/kangax/html-minifier#options-quick-reference)
To use custom [html-minifier options](https://github.com/DanielRuf/html-minifier-terser#options-quick-reference)
pass an object to `minify` instead. This object will not be merged with the defaults above.

To disable minification during production mode set the `minify` option to `false`.
Expand Down
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -442,7 +442,7 @@ class HtmlWebpackPlugin {
? this.injectAssetsIntoHtml(html, assets, assetTags)
: html;
const htmlAfterMinification = typeof this.options.minify === 'object'
? require('html-minifier').minify(htmlAfterInjection, this.options.minify)
? require('html-minifier-terser').minify(htmlAfterInjection, this.options.minify)
: htmlAfterInjection;
return Promise.resolve(htmlAfterMinification);
}
Expand Down

0 comments on commit 24bf1b5

Please sign in to comment.