{"id":41223,"library":"hexo-filter-htmlminifier","title":"hexo-filter-htmlminifier","description":"A Hexo plugin that minifies output HTML files using HTML Minifier. Current stable version is 1.0.2. This plugin integrates into Hexo's filter system, allowing configuration of HTML minification options such as whitespace collapse, comment removal, and attribute quote removal. It is specifically designed for Hexo static site generators and is not a general-purpose minifier. Alternative standalone minifiers include html-minifier-terser.","status":"active","version":"1.0.2","language":"javascript","source_language":"en","source_url":"https://github.com/yangliu/hexo-filter-htmlminifier","tags":["javascript","hexo","filter","html","minifier"],"install":[{"cmd":"npm install hexo-filter-htmlminifier","lang":"bash","label":"npm"},{"cmd":"yarn add hexo-filter-htmlminifier","lang":"bash","label":"yarn"},{"cmd":"pnpm add hexo-filter-htmlminifier","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"core dependency for HTML minification","package":"html-minifier","optional":false},{"reason":"peer dependency for Hexo filter integration","package":"hexo","optional":false}],"imports":[{"note":"Installed as a regular dependency (not dev) because it's used during Hexo generation.","wrong":"npm install hexo-filter-htmlminifier --save-dev","symbol":"hexo-filter-htmlminifier","correct":"npm install hexo-filter-htmlminifier --save"},{"note":"The configuration key must be exactly html_minifier (lowercase, underscores).","wrong":"Add to _config.yml under hexo_filter_htmlminifier:","symbol":"Configuration","correct":"Add to _config.yml under html_minifier:"},{"note":"Priority should be a high number (e.g., 10000) to ensure it runs after other filters.","wrong":"html_minifier:\n  priority: 0","symbol":"Priority setting","correct":"html_minifier:\n  priority: 10000"}],"quickstart":{"code":"npm install hexo-filter-htmlminifier --save\n\n# In _config.yml of your Hexo site:\nhtml_minifier:\n  collapseWhitespace: true\n  removeComments: true\n  removeRedundantAttributes: true\n  removeScriptTypeAttributes: true\n  removeStyleLinkTypeAttributes: true","lang":"javascript","description":"Installs the plugin and configures HTML minification options in Hexo's _config.yml file."},"warnings":[{"fix":"Set priority to a high value like 10000 to run after others.","message":"Plugin may conflict with other Hexo filters (e.g., GZip filter) if priority is not set correctly.","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Refer to HTML Minifier documentation for valid options.","message":"Options passed must match HTML Minifier's expected inputs; invalid options may cause errors.","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Use 'html_minifier:' in _config.yml.","message":"Configuration key must be exactly 'html_minifier' (lowercase, underscores), not camelCase or other variations.","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Test after Hexo updates; consider alternative plugins like hexo-html-minify if needed.","message":"The plugin may not receive updates; check compatibility with newer Hexo versions.","severity":"deprecated","affected_versions":">=1.0.0"}],"env_vars":null,"search_vec":"'1.0.2':20 'allow':29 'altern':62 'attribut':42 'collaps':38 'comment':39 'configur':30 'current':16 'design':48 'file':12 'filter':3,27,72 'general':59 'general-purpos':58 'generat':53 'hexo':2,6,25,50,71 'hexo-filter-htmlminifi':1 'html':11,14,32,67,73 'html-minifier-ters':66 'htmlminifi':4 'includ':65 'integr':23 'javascript':70 'minif':33 'minifi':9,15,61,64,68,74 'option':34 'output':10 'plugin':7,22 'purpos':60 'quot':43 'remov':40,44 'site':52 'specif':47 'stabl':17 'standalon':63 'static':51 'system':28 'terser':69 'use':13 'version':18 'whitespac':37","created_at":"2026-06-04T18:51:22.444597+00:00","updated_at":"2026-06-04T18:51:22.444597+00:00","problems":[{"fix":"Run 'npm install hexo-filter-htmlminifier --save' to install both the plugin and its dependency.","cause":"Missing dependency or npm install not run.","error":"Error: Cannot find module 'html-minifier'"},{"fix":"Check the spelling of options; refer to HTML Minifier's documentation for supported options.","cause":"An option key in the config is not recognized by HTML Minifier.","error":"WARN: Skipping unknown option: xxx"},{"fix":"Set priority to 10000 or higher in config to ensure this filter runs after others.","cause":"Other filters (e.g., GZip) running before HTML minification, causing output to not be minified.","error":"Hexo filter execution order issue"}],"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/yangliu/hexo-filter-htmlminifier#readme","github":"https://github.com/yangliu/hexo-filter-htmlminifier","docs":null,"changelog":null,"pypi":null,"npm":"hexo-filter-htmlminifier","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}}