Registry / devops / digo-html-minifier

digo-html-minifier

JSON →
library0.1.0jsnpmunverified

A Digo plugin that minifies HTML files using html-minifier. Version 0.1.0 is the current stable release. It integrates seamlessly with Digo build system, providing extensive configuration options mirroring html-minifier's API. Key differentiators include automatic minification of inline CSS and JS, and support for custom fragment handling. The plugin does not generate source maps. It is primarily for use within the Digo ecosystem.

npm install digo-html-minifier
INSTALL
IMPORT
SIG · DIGO-HTML-MINIFIER
D
digo-html-minifier
devopsjavascriptv0.1.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 (plugin)
digo.src('*.html').pipe('digo-html-minifier')
import digoHtmlMinifier from 'digo-html-minifier'
This is a Digo plugin, not a standalone library. Use it via digo's .pipe() method with the plugin name string.
Options object
digo.src('*.html').pipe('digo-html-minifier', { removeComments: true })
digo.src('*.html').pipe('digo-html-minifier')({ removeComments: true })
Options should be passed as the second argument to .pipe(). Do not call the plugin function directly.
CommonJS require (if needed)
const digo = require('digo'); digo.src('*.html').pipe('digo-html-minifier');
const plugin = require('digo-html-minifier'); plugin(digo.src('*.html'));
The plugin is loaded by name string in .pipe(), not by requiring the module directly.

Shows how to use the plugin within Digo to minify HTML files with common options.

const digo = require('digo'); digo.src('*.html').pipe('digo-html-minifier', { removeComments: true, collapseWhitespace: true, minifyCSS: true, minifyJS: true }).dest('dist');
Debug
Known issues
gotchaPlugin does not generate source maps; do not rely on source map support.
fix
Use alternative minification approach if source maps are required.
affects: >=0.0.0
gotchaThe plugin is designed to work with Digo build system; it cannot be used standalone outside of Digo pipeline.
fix
Ensure Digo is installed and pipeline is configured properly.
affects: >=0.0.0
gotchaThe plugin automatically sets minifyCSS, minifyJS, and minifyURLs to false if not explicitly provided via options. To enable minification, set them to true or an object.
fix
Explicitly set minifyCSS: true, minifyJS: true, or minifyURLs: true in options.
affects: >=0.0.0
Errors
Common errors & fixes
Error: Cannot find module 'digo-html-minifier'
Plugin not installed globally or locally; Digo expects it in require path.
fix
Run 'npm install digo-html-minifier -g' for global install, or 'npm install digo-html-minifier --save-dev' for local project.
TypeError: digo.src(...).pipe(...) is not a function
digo is not properly imported or Digo v0.x has different API.
fix
Use 'const digo = require('digo');' and ensure Digo version is compatible.
Upgrade
Version history
0.1.0latest on npm
Audit
Dependencies
digorequiredRuntime peer dependency - this is a plugin for the Digo build system
html-minifierrequiredCore minification engine
Agent activity
6 hits · last 30 days
node
6
Resources
digo-html-minifier — npm install digo-html-minifier · libregistry