diff --git a/README.md b/README.md index eef386c..dca91a7 100644 --- a/README.md +++ b/README.md @@ -67,7 +67,7 @@ Allowed values are as follows: - `templateContent`: A html string or a function returning the html (supports [blueimp templates](https://github.com/blueimp/JavaScript-Templates)). - `inject`: `true | 'head' | 'body' | false` Inject all assets into the given `template` or `templateContent` - When passing `true` or `'body'` all javascript resources will be placed at the bottom of the body element. `'head'` will place the scripts in the head element. - `favicon`: Adds the given favicon path to the output html. -- `minify`: `true | {...} | false` Set to true or pass a [html-minifier](https://github.com/kangax/html-minifier#options-quick-reference) options object to minify the output. +- `minify`: `{...} | false` Pass a [html-minifier](https://github.com/kangax/html-minifier#options-quick-reference) options object to minify the output. - `hash`: `true | false` if `true` then append a unique webpack compilation hash to all included scripts and css files. This is useful for cache busting. - `chunks`: Allows you to add only some chunks (e.g. only the unit-test chunk) diff --git a/index.js b/index.js index 59d2834..f014fc8 100644 --- a/index.js +++ b/index.js @@ -130,9 +130,7 @@ HtmlWebpackPlugin.prototype.emitHtml = function(compilation, htmlTemplateContent // Minify the html output if (this.options.minify) { var minify = require('html-minifier').minify; - // If `options.minify` is set to true use the default minify options - var minifyOptions = _.isObject(this.options.minify) ? this.options.minify : {}; - html = minify(html, minifyOptions); + html = minify(html, this.options.minify); } compilation.assets[outputFilename] = {