Registry / devops / hexo-html-min-beautify

hexo-html-min-beautify

JSON →
library0.0.1jsnpmunverified

Hexo plugin that minifies and beautifies generated HTML files using html-minifier and js-beautify. Version 0.0.1 (initial release). Designed as a Hexo filter plugin, processing HTML output after generation. Differentiates by combining both minification and beautification in one plugin, with configurable options exposed via _config.yml. Conflicts may arise with other Hexo HTML processing plugins.

npm install hexo-html-min-beautify
INSTALL
IMPORT
SIG · HEXO-HTML-MIN-BEAU
H
hexo-html-min-beautify
devopsjavascriptv0.0.1
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

(default)
// Plugin is auto-loaded by Hexo when installed
require('hexo-html-min-beautify')
Hexo plugins are not imported directly; they are activated by being listed as a dependency. No explicit require needed.
config
// Options set in Hexo _config.yml under 'html_min_beautify' key
new HtmlMinBeautify(opts)
Configuration is done via YAML, not programmatic instantiation.
filter
// Automatically registers 'after_render:html' filter
// No importable symbol; filter registration is internal
The plugin hooks into Hexo's filter system internally; no exports for manual use.

Install the plugin, configure beautification and minification options in _config.yml, and generate site.

// 1. Install plugin npm install hexo-html-min-beautify --save // 2. Enable in Hexo _config.yml: # Hexo Html Min-beautify html_min_beautify: enable: true beautify: indent_size: 2 indent_char: ' ' end_with_newline: true minify: collapseWhitespace: true preserveLineBreaks: true minifyJS: true minifyCSS: true // 3. Run Hexo generate npx hexo generate
Debug
Known issues
gotchaPlugin only processes HTML files; does not affect other file types (CSS, JS).
fix
Use separate plugins or tools for CSS/JS processing.
affects: >=0.0.0
deprecatedOptions like 'minifyJS' and 'minifyCSS' rely on html-minifier defaults; ensure html-minifier is installed and up-to-date.
fix
Verify html-minifier is in package.json; consider using newer alternatives like hexo-filter-minify.
affects: >=0.0.0
gotchaConflicts with other HTML-processing Hexo plugins (e.g., hexo-inject, hexo-filter-beautify) due to multiple filters on 'after_render:html'.
fix
Disable other HTML filters or ensure they run first/last. Check execution order via Hexo filter priority.
affects: >=0.0.0
Errors
Common errors & fixes
ENOENT: no such file or directory, open 'public/index.html'
Hexo has not generated the output directory yet.
fix
Run 'npx hexo clean && npx hexo generate' before invoking the plugin.
Cannot find module 'html-minifier'
Missing dependency; html-minifier should be auto-installed but may be missing.
fix
Run 'npm install html-minifier --save' to ensure it is installed.
TypeError: Cannot read property 'replace' of undefined
Plugin encountered a non-string value in HTML data during filter.
fix
Check if other plugins or your theme output non-string results. Ensure hexo version compatibility.
Upgrade
Version history
0.0.1latest on npm
Audit
Dependencies
hexorequiredHexo framework plugin; runtime peer dependency
html-minifierrequiredHTML minification library
js-beautifyrequiredHTML beautification library
Agent activity
6 hits · last 30 days
node
6
Resources
hexo-html-min-beautify — npm install hexo-html-min-beautify · libregistry