Passing true to minify does nothing
All `html-minifier` options are `false` by default, so passing just true does nothing to the output
This commit is contained in:
parent
95feed96ba
commit
909b811d70
|
|
@ -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)
|
||||
|
|
|
|||
4
index.js
4
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] = {
|
||||
|
|
|
|||
Loading…
Reference in New Issue