hexo-html-minifier
Minify HTML files with HTMLMinifier.
Installation
$ npm install hexo-html-minifier --save
Options
You can set options of HTMLMinifier in the main _config.yml
file:
html_minifier:exclude:
- exclude: Exclude files from being minified. Support globbing patterns.
Default options:
html_minifier:collapseBooleanAttributes: truecollapseWhitespace: true# Ignore '<!-- more -->' https://hexo.io/docs/tag-plugins#Post-ExcerptignoreCustomComments: [ !!js/regexp /^\s*more/]removeComments: trueremoveEmptyAttributes: trueremoveScriptTypeAttributes: trueremoveStyleLinkTypeAttributes: trueminifyJS: trueminifyCSS: true
- ignoreCustomComments: Array of regex'es that allow to ignore certain comments, when matched. Need to prepend
!!js/regexp
to support regex.
Description of the above options and other available options, see HTMLMinifier