A Hexo plugin that minifies HTML output files using HTMLMinifier. Current stable version is 1.0.0, with infrequent releases. It integrates directly as a Hexo filter, providing easy configuration through the main _config.yml and supports excluding files via globbing. Compared to other minifiers, it offers deep integration with Hexo's build pipeline and respects Hexo's 'more' tag comments by default.
npm install hexo-html-minifierNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Install the plugin via npm. After installation, HTML files will be minified automatically on hexo generate.
Ensure option names match HTMLMinifier documentation exactly (e.g., 'collapseWhitespace' not 'collapseWhiteSpace').
Use !!js/regexp /pattern/ in _config.yml (e.g., ignoreCustomComments: [ !!js/regexp /^\s*more/ ])
Test glob patterns using micromatch documentation (e.g., 'exclude: **/draft/*.html').
Validate HTML with tools like W3C validator. Disable minification for problematic files via 'exclude' option.
Ensure ignoreCustomComments is an array of RegExp objects using !!js/regexp YAML type.