Registry / devops / scully-plugin-minify-html

scully-plugin-minify-html

JSON →
library6.0.0jsnpmunverified

A Scully post-rendering plugin that minifies HTML output to reduce file size and improve SEO. Current stable version 6.0.0 works with Scully >=1.0.0. Released irregularly. Key differentiator: simple integration, leverages popular minifier libraries under the hood.

npm install scully-plugin-minify-html
INSTALL
IMPORT
SIG · SCULLY-PLUGIN-MINI
S
scully-plugin-minify-html
devopsjavascriptv6.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.

MinifyHtml
import { MinifyHtml } from 'scully-plugin-minify-html';
const MinifyHtml = require('scully-plugin-minify-html');
ESM only; CJS require fails. Plugin must be registered via Scully config.
getPluginOptions
import { getPluginOptions } from 'scully-plugin-minify-html';
const getPluginOptions = require('scully-plugin-minify-html').getPluginOptions;
Same ESM requirement.
type PostRender
import type { PostRender } from '@scullyio/scully';
import { PostRender } from 'scully-plugin-minify-html';
PostRender type is from Scully core, not this plugin.

Shows installation, registration of the plugin in Scully config, and optional customization of minifier options.

// Install: npm install --save-dev scully-plugin-minify-html // Configure in scully.your-app.config.ts: import { ScullyConfig } from '@scullyio/scully'; import { MinifyHtml } from 'scully-plugin-minify-html'; const defaultPostRenderers = ['MinifyHtml']; export const config: ScullyConfig = { projectRoot: './src', projectName: 'your-app', outDir: './dist/static', defaultPostRenderers, routes: {}, }; // Optional: customize minifier options import { getPluginOptions } from 'scully-plugin-minify-html'; getPluginOptions().minifierOptions = { collapseWhitespace: true, removeComments: true, minifyCSS: false, };
Debug
Known issues
breakingVersion 6.x removed support for Scully <1.0.0
fix
Upgrade Scully to >=1.0.0 or pin plugin to version 5.x
affects: >=6.0.0
deprecatedOptions via global property getPluginOptions() is deprecated; use Scully config route plugins instead
fix
Migrate to route plugin configuration in Scully config
affects: >=5.0.0
gotchaPlugin must be imported as ESM; CommonJS require will fail
fix
Use import syntax and ensure TypeScript module is set to ESNext
affects: >=6.0.0
gotchaMinifier options set via getPluginOptions() are global; different routes cannot have separate settings
fix
Use route-specific plugin configuration if available in newer versions
affects: >=4.0.0 <=5.0.0
Errors
Common errors & fixes
Cannot find module 'scully-plugin-minify-html'
Package not installed or ESM import used in CJS context
fix
Run npm install --save-dev scully-plugin-minify-html or switch to ESM module system
Error: MinifyHtml is not a post-renderer
Plugin not added to defaultPostRenderers or postRenderers array in Scully config
fix
Add 'MinifyHtml' to defaultPostRenderers array in scully.config.ts
TypeError: getPluginOptions is not a function
getPluginOptions imported incorrectly (CommonJS) or wrong version
fix
Use named import: import { getPluginOptions } from 'scully-plugin-minify-html';
Upgrade
Version history
6.0.0latest on npm
Audit
Dependencies
@scullyio/scullyrequiredpeer dependency required for plugin infrastructure
json5requiredpeer dependency used for configuration parsing
Agent activity
6 hits · last 30 days
node
6
Resources
scully-plugin-minify-html — npm install scully-plugin-minify-html · libregistry