html-minifier config

This commit is contained in:
Alexandre Chopin 2016-12-12 23:15:54 +01:00
parent 4ebe6f7ac8
commit 0df05fd633

View File

@ -90,7 +90,24 @@ module.exports = function () {
return co(function * () { return co(function * () {
var { html } = yield self.renderRoute(route) var { html } = yield self.renderRoute(route)
html = minify(html, { 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 var path = join(route, sep, 'index.html') // /about -> /about/index.html
debug('Generate file: ' + path) debug('Generate file: ' + path)