Registry / devops / docpad-plugin-htmlmin

docpad-plugin-htmlmin

JSON →
library2.4.3jsnpmunverified

DocPad plugin for minifying HTML output using html-minifier, version 2.4.3 (last released 2021). Designed exclusively for DocPad v6.x projects. It provides per-template YAML front-matter control and environment-aware configuration (e.g., disabled in development). No active maintenance since 2021 – check compatibility before use.

npm install docpad-plugin-htmlmin
INSTALL
IMPORT
SIG · DOCPAD-PLUGIN-HTML
D
docpad-plugin-htmlmin
devopsjavascriptv2.4.3
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 (as plugin object)
module.exports = { name: 'htmlmin', ... }
import htmlmin from 'docpad-plugin-htmlmin'
This is a DocPad plugin, not a standalone module. It is loaded by DocPad's plugin system via configuration files, not imported directly.

Shows how to enable per-template minification via YAML front-matter and global configuration in DocPad.

// In your DocPad configuration file (docpad.coffee or docpad.js): { plugins: { htmlmin: { removeComments: true, collapseWhitespace: true, environments: { development: { enabled: false } } } } } // In a template file (.html.eco, .html.md, etc.): --- htmlmin: true --- <h1>Hello World</h1> <!-- This comment will be removed when minified -->
Debug
Known issues
gotchaPlugin requires DocPad v6.x – not compatible with v7 or later.
fix
Use DocPad v6.x or switch to a different HTML minification approach for newer DocPad versions.
affects: >=2.0.0
deprecatedDocPad itself is in maintenance mode; this plugin is unlikely to receive updates.
fix
Migrate to an alternative static site generator or handle HTML minification outside DocPad.
affects: >=1.0.0
gotchahtmlmin option in front-matter must be a boolean or object; setting 'true' uses defaults, but misspelling 'htmlmin' will silently not minify.
fix
Ensure front-matter key is exactly 'htmlmin' and value is a boolean or configuration object.
affects: >=2.0.0
gotchaDevelopment environment disables minification by default; if you want minification in dev, you must override the environment config.
fix
Set 'enabled: true' in the development environment configuration or remove the environment block.
affects: >=2.0.0
Errors
Common errors & fixes
Error: Cannot find module 'docpad-plugin-htmlmin'
Plugin not installed or DocPad unable to locate it.
fix
Run 'docpad install htmlmin' to install the plugin via DocPad's package manager.
Warning: No plugin found for 'htmlmin'
DocPad ignores unknown plugin names in config; the plugin is not loaded.
fix
Ensure the plugin is installed and its name matches exactly: 'htmlmin'.
TypeError: Cannot read property 'htmlmin' of undefined
Configuration for 'plugins' section is missing or malformed.
fix
Wrap plugin config inside { plugins: { htmlmin: {...} } } in your DocPad config file.
Upgrade
Version history
2.4.3latest on npm
Audit
Dependencies
docpadrequiredpeer dependency: plugin requires DocPad v6.x to function
Agent activity
10 hits · last 30 days
node
8
Amazon
2
Resources
docpad-plugin-htmlmin — npm install docpad-plugin-htmlmin · libregistry