Registry / devops / html-pages-brunch

html-pages-brunch

JSON →
library2.8.0jsnpmunverified

Brunch plugin that adds HTMLMinifier support to compile, reload-on-save, validate, and minify HTML templates outside the assets directory. Version 2.8.0 integrates with html-minifier and allows folders-by-feature architecture. The plugin provides default production-ready optimization and configurable minification options. Differs from other Brunch HTML plugins by supporting front matter minification, customizable destination paths, and compile assets feature.

npm install html-pages-brunch
INSTALL
IMPORT
SIG · HTML-PAGES-BRUNCH
H
html-pages-brunch
devopsjavascriptv2.8.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.

plugin
module.exports = { plugins: { htmlPages: { ... } } }
const htmlPages = require('html-pages-brunch')
This is a Brunch plugin, not imported directly; configure in brunch-config.js.

Install and configure html-pages-brunch with basic minification options in a Brunch project.

// Install the plugin npm install --save-dev html-pages-brunch // Configure in brunch-config.js module.exports = { plugins: { htmlPages: { htmlMin: { collapseWhitespace: true, removeComments: true }, destination(path) { return path.replace(/^app[\\/](.*)\.html$/, "$1.html"); } } } }
Debug
Known issues
gotchaMinification is disabled by default in development; enable with `optimize: true`.
fix
Set `optimize: true` in config if minification is needed in dev.
affects: >=2.0.0
deprecatedThe `htmlMin` options are passed directly to html-minifier; some options may become deprecated in future html-minifier versions.
fix
Check html-minifier docs for up-to-date options.
affects: >=2.0.0
gotchaFront matter removal occurs even when plugin is disabled if `forceRemoveFrontMatter` is true.
fix
Set `forceRemoveFrontMatter: false` to prevent removal when disabled.
affects: >=2.0.0
Errors
Common errors & fixes
Error: Cannot find module 'html-minifier'
Missing dependency html-minifier
fix
Run `npm install --save-dev html-minifier`.
TypeError: path.replace is not a function
destination setting must be a function that returns a string
fix
Ensure `destination` is a function returning a string (e.g., `(path) => path.replace(/pattern/, 'replacement')`).
Error: Plugin html-pages-brunch is not registered
Plugin not installed or not added to plugins in config
fix
Run `npm install --save-dev html-pages-brunch` and add `plugins.htmlPages` config.
Upgrade
Version history
2.8.0latest on npm
Audit
Dependencies
html-minifierrequiredCore dependency for HTML minification
brunchrequiredPlugin requires Brunch as the build tool
Agent activity
4 hits · last 30 days
node
4
Resources
html-pages-brunch — npm install html-pages-brunch · libregistry