html-minifier config

This commit is contained in:
Alexandre Chopin 2016-12-12 23:15:54 +01:00
parent 4ebe6f7ac8
commit 0df05fd633
1 changed files with 18 additions and 1 deletions

View File

@ -90,7 +90,24 @@ module.exports = function () {
return co(function * () {
var { html } = yield self.renderRoute(route)
html = minify(html, {
collapseWhitespace: true
collapseBooleanAttributes: true,
collapseWhitespace: true,
decodeEntities: true,
minifyCSS: true,
minifyJS: true,
processConditionalComments: true,
removeAttributeQuotes: true,
removeComments: true,
removeEmptyAttributes: true,
removeOptionalTags: true,
removeRedundantAttributes: true,
removeScriptTypeAttributes: true,
removeStyleLinkTypeAttributes: true,
removeTagWhitespace: true,
sortAttributes: true,
sortClassName: true,
trimCustomFragments: true,
useShortDoctype: true
})
var path = join(route, sep, 'index.html') // /about -> /about/index.html
debug('Generate file: ' + path)