{"id":41226,"library":"hexo-html-minifier","title":"hexo-html-minifier","description":"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.","status":"active","version":"1.0.0","language":"javascript","source_language":"en","source_url":"https://github.com/hexojs/hexo-html-minifier","tags":["javascript","hexo","filter","html","minify"],"install":[{"cmd":"npm install hexo-html-minifier","lang":"bash","label":"npm"},{"cmd":"yarn add hexo-html-minifier","lang":"bash","label":"yarn"},{"cmd":"pnpm add hexo-html-minifier","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Core dependency for HTML minification functionality.","package":"html-minifier","optional":false}],"imports":[{"note":"No JavaScript import needed; plugin is activated by being in package.json. Configuration is done via _config.yml.","symbol":"hexo-html-minifier","correct":"npm install hexo-html-minifier --save"}],"quickstart":{"code":"npm install hexo-html-minifier --save","lang":"javascript","description":"Install the plugin via npm. After installation, HTML files will be minified automatically on hexo generate."},"warnings":[{"fix":"Ensure option names match HTMLMinifier documentation exactly (e.g., 'collapseWhitespace' not 'collapseWhiteSpace').","message":"Options set in _config.yml override defaults but are merged; be aware that some options may not be recognized if misspelled.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Use !!js/regexp /pattern/ in _config.yml (e.g., ignoreCustomComments: [ !!js/regexp /^\\s*more/ ])","message":"The 'ignoreCustomComments' option requires YAML type !!js/regexp for regex patterns; plain strings won't work.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Test glob patterns using micromatch documentation (e.g., 'exclude: **/draft/*.html').","message":"Exclude patterns use micromatch globbing; incorrect patterns may not exclude files properly.","severity":"gotcha","affected_versions":">=1.0.0"}],"env_vars":null,"search_vec":"'1.0.0':19 'build':54 'comment':62 'compar':43 'config.yml':36 'configur':32 'current':15 'deep':49 'default':64 'direct':25 'easi':31 'exclud':39 'file':12,40 'filter':29,67 'glob':42 'hexo':2,6,28,52,58,66 'hexo-html-minifi':1 'html':3,10,68 'htmlminifi':14 'infrequ':21 'integr':24,50 'javascript':65 'main':35 'minifi':4,9,46,69 'offer':48 'output':11 'pipelin':55 'plugin':7 'provid':30 'releas':22 'respect':57 'stabl':16 'support':38 'tag':61 'use':13 'version':17 'via':41","created_at":"2026-06-04T18:51:22.758779+00:00","updated_at":"2026-06-04T18:51:22.758779+00:00","problems":[{"fix":"Validate HTML with tools like W3C validator. Disable minification for problematic files via 'exclude' option.","cause":"HTMLMinifier encounters invalid HTML or syntax errors.","error":"Error: Minification failed for..."},{"fix":"Ensure ignoreCustomComments is an array of RegExp objects using !!js/regexp YAML type.","cause":"ignoreCustomComments is not an array or contains invalid regex.","error":"TypeError: ignoreCustomComments is not iterable"}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":"https://github.com/hexojs/hexo-html-minifier#readme","github":"https://github.com/hexojs/hexo-html-minifier","docs":null,"changelog":null,"pypi":null,"npm":"hexo-html-minifier","openapi_spec":null,"status_page":null,"smithery":null,"categories":["devops"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-04","next_check":"2026-09-02","install_tag":null}}