Registry / devops / hexo-html-minifier-terser

hexo-html-minifier-terser

JSON →
library1.0.0jsnpmunverified

Hexo plugin to minify HTML output using html-minifier-terser. Current stable version is 1.0.0 (released January 2022). This plugin integrates with Hexo's filter system to automatically minify generated HTML files during the build process. It provides configurable options via Hexo's _config.yml, including exclusion patterns and all html-minifier-terser settings. Compared to alternatives like hexo-html-minifier, this plugin uses the maintained terser fork of html-minifier, offering continued support and security updates.

npm install hexo-html-minifier-terser
INSTALL
IMPORT
SIG · HEXO-HTML-MINIFIER
H
hexo-html-minifier-terser
devopsjavascriptv1.0.0
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 import (plugin registration)
require('hexo-html-minifier-terser')
import hexoHtmlMinifierTerser from 'hexo-html-minifier-terser'
Hexo plugins are loaded via require() in Hexo's scripts directory.

Installs the plugin, configures HTML minification options in Hexo's config, and runs the build process.

// In your Hexo project root, install the plugin and its peer dependency: $ npm install hexo-html-minifier-terser html-minifier-terser --save // Add or modify your _config.yml: html_minifier: exclude: - '**/admin/**' collapseBooleanAttributes: true collapseWhitespace: true removeComments: true minifyJS: true minifyCSS: true // Run build: $ hexo generate
Debug
Known issues
breakinghtml-minifier-terser version 7.0.0 dropped Node.js < 14 support. Ensure Node.js >= 14 if using latest.
fix
Update Node.js to version 14 or higher, or pin html-minifier-terser to 6.x.
affects: >=7.0.0
Errors
Common errors & fixes
Error: Cannot find module 'html-minifier-terser'
html-minifier-terser is a peer dependency and not installed automatically.
fix
Run: npm install html-minifier-terser --save
Upgrade
Version history
1.0.0latest on npm
Audit
Dependencies
html-minifier-terserrequiredCore minification engine; must be installed separately as a peer dependency
Agent activity
6 hits · last 30 days
node
6
Resources
hexo-html-minifier-terser — npm install hexo-html-minifier-terser · libregistry