# 模板

# html.options

html.options: object

HTML 压缩。详细配置 (opens new window)

默认值为:

{
  collapseWhitespace: true,
  minifyCSS: true,
  minifyJS: {
    compress: {
      drop_console: true
    }
  },
  processConditionalComments: true,
  removeComments: true,
  removeEmptyAttributes: true,
  removeScriptTypeAttributes: true,
  removeStyleLinkTypeAttributes: true
}

🌰 举个栗子:

module.exports = {
  html: {
    options: {
      collapseWhitespace: false,
      minifyCSS: true,
      minifyJS: {
        compress: {
          drop_console: false
        }
      }
    }
  }
  // 其他配置项...
};
Last Updated: 4 years ago