-
-
Notifications
You must be signed in to change notification settings - Fork 205
Documentation for minimize
option
#81
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
There is a difference, and you're doing it correctly. Although the option isn't particularly well documented, it's mainly b/c it assumes you understand well how Webpack works (I can't say I do yet). But, looking at the source it's pretty clear. First it looks for a config query string as the key name (e.g. Later it looks for the That's the sucky part because it's a pretty messy way to invoke the minifier. If html-minifier ever did a config validation that threw errors it would break this loader. A better solution would be to just check |
To be clear what I mean in the last paragraph: Instead of (current config): {
module: {loaders: [{test: /\.html$/, loader: 'html'}]},
htmlLoader: {
minimize: true,
collapseBooleanAttributes: true,
collapseWhitespace: true,
removeAttributeQuotes: true,
removeComments: true,
removeEmptyAttributes: true,
removeRedundantAttributes: false,
removeScriptTypeAttributes: true,
removeStyleLinkTypeAttributes: true
}
} I think this makes more sense: {
module: {loaders: [{test: /\.html$/, loader: 'html'}]},
htmlLoader: {
minimize: {
collapseBooleanAttributes: true,
collapseWhitespace: true,
removeAttributeQuotes: true,
removeComments: true,
removeEmptyAttributes: true,
removeRedundantAttributes: false,
removeScriptTypeAttributes: true,
removeStyleLinkTypeAttributes: true
}
}
} |
Continued from #34 (comment) - I should have made a new issue in the first place, my bad.
Anyway, my question is where is the
minimize
option documented? Are there options I can pass to it? Is it on or off by default? I have looked up and down the docs, but I only saw the comment about--optimize-minimize
which I'm not sure does anything 😕After looking through the source a bit, I've enabled it explicitly with:
but I'm not really sure if there is a difference being made on the HTML I'm loading in (via other loaders in the pipeline).
The text was updated successfully, but these errors were encountered: