Skip to content
PluginStats

html-minimizer-webpack-plugin weekly downloads statistics

By webpack (4 listings) · npm · Webpack plugins

html minimizer plugin for Webpack

View on npm Stale · Oct 17, 2026

html-minimizer-webpack-plugin has 6,292 recorded weekly downloads on npm, a decrease of 61.0% over the past 30 days, ranking #1028 of 2,256 tracked listings.

Weekly downloads
6,292
Official API · Oct 17, 2026
7-day growth
-54.3%
-7.5K weekly downloads
30-day growth
-61.0%
-9.9K weekly downloads
90-day growth
-55.4%
-7.8K weekly downloads
Rank
#1028
Among tracked npm listings

About html-minimizer-webpack-plugin

[![npm][npm]][npm-url] [![node][node]][node-url] [![tests][tests]][tests-url] [![cover][cover]][cover-url] [![discussion][discussion]][discussion-url] [![size][size]][size-url]

html-minimizer-webpack-plugin

This plugin can use 3 tools to optimize and minify your HTML:

• swc - very fast Rust-based platform for the Web. • html-minifier-terser (by default) - JavaScript-based HTML minifier. • @minify-html/node - A Rust HTML minifier meticulously optimised for speed and effectiveness, with bindings for other languages.

This plugin integrates seamlessly into your Webpack build pipeline to reduce HTML size and improve loading performance.

Getting Started

To begin, you'll need to install html-minimizer-webpack-plugin:

or

or

Additional step: If you want to use @swc/html you need to install it:

or

or

Additional step: If you want to use @minify-html/node you need to install it:

or

or

Then add the plugin to your webpack configuration. For example:

webpack.config.js

[!NOTE]

HTML will only be minimized in production mode by default. To enable minification in development, explicitly set optimization.minimize: true.

Finally, run webpack using the method you normally use (e.g., via CLI or an npm script).

[!NOTE]

Removing and collapsing spaces in the tools differ (by default).

  • @swc/html - Remove and collapse whitespaces only in safe places (for example - around html and body elements, inside the head element and between metadata elements - /script/link/etc.) - html-minifier-terser - Always collapse multiple whitespaces to 1 space (never remove it entirely), but you can change it using options - @minify-html/node - Please read documentation https://github.com/wilsonzlin/minify-html#whitespace for detailed whitespace behavior.

Options

• test • include • exclude • parallel • minify • minimizerOptions

test

Type:

Default: /.html(?.*)?$/i

Test to match files against.

include

Type:

Default: undefined

Files to include for minification.

webpack.config.js

exclude

Type:

Default: undefined

Files to exclude from minification.

webpack.config.js

parallel

Type:

Default: true

Enables multi-process parallelization to improve build performance.

• If true, uses os.cpus().length - 1 or os.availableParallelism() - 1 (if available). • If number, sets the number of concurrent workers.

[!NOTE]

Parallelization can speed up your build significantly and is therefore highly recommended.

boolean

Enable or disable multi-process parallel running.

webpack.config.js

number

Enable multi-process parallel running and set number of concurrent runs.

webpack.config.js

minify

Type:

Default: HtmlMinimizerPlugin.htmlMinifierTerser

Allows you to override default minify function. By default, plugin uses html-minifier-terser package.

We currently support:

• HtmlMinimizerPlugin.swcMinify (used to compress HTML documents, i.e. with HTML doctype and // tags) • HtmlMinimizerPlugin.swcMinifyFragment (used to compress HTML fragments, i.e. when you have part of HTML which will be inserted into another HTML parts) • HtmlMinimizerPlugin.htmlMinifierTerser • HtmlMinimizerPlugin.minifyHtmlNode

[!NOTE]

The difference between swcMinify and swcMinifyFragment is the error reporting. You will get errors (invalid or broken syntax) if you have them in your HTML document or fragment. Which allows you to see all the errors and problems at the build stage.

Useful for using and testing unpublished versions or forks.

[!WARNING]

Always use require inside minify function when parallel option enabled.

function

You can define a custom minify function, giving full control over how the HTML is processed.

webpack.config.js

array

If an array of functions is passed to the minify option, the minimizerOptions can be either as:

• An array; If minimizerOptions is array, the function index in the minify array corresponds to the options object with the same index in the minimizerOptions array. • A single object; If you use minimizerOptions like object, all minify function accept it.

webpack.config.js

minimizerOptions

Type:

Default:

Html-minifier-terser optimizations options.

object

Applies the same options to the default or custom minify function.

array

The function index in the minify array corresponds to the options object with the same index in the minimizerOptions array. If you use minimizerOptions like object, all minify function accept it.

webpack.config.js

Examples

swc/html

Available options.

HTML Documents:

HTML Fragments:

Use this for partial HTML files (e.g. inside tags or HTML strings).

@minify-html/node

Available options.

HTML Documents:

You can use multiple HtmlMinimizerPlugin plugins to compress different files with the different minify function.

Contributing

We welcome all contributions! If you're new here, please take a moment to review our contributing guidelines before submitting issues or pull requests.

CONTRIBUTING

License

MIT

Description from the npm listing.

  • html
  • webpack
  • webpack-plugin
  • minimize
  • minimizer
  • minify
  • minifier
  • optimize
  • optimizer

README badge

Show your rank in a README or on your website. The badge updates automatically.

Charts

Images: 30d · 1y · all time · 1600×900 dark

Adoption over time

html-minimizer-webpack-plugin weekly downloads on npm, last 90 days: 6,292 weekly downloads as of Oct 17, 2026, -55.4% over 90 days.html-minimizer-webpack-pluginWeekly downloads on npm · Last 90 days6,292downloads / week-55.4% over 90 days05K10K15K20KJul 19Aug 3Aug 18Sep 2Sep 17Oct 2Oct 17downloads / weekobservedarchived (Internet Archive)no observationsJul 22, 2026 – Oct 17, 2026 · 88 observations · Updated Oc…pluginstats.com
html-minimizer-webpack-plugin weekly downloads on npm, last 90 days: 6,292 weekly downloads as of Oct 17, 2026, -55.4% over 90 days.

7/30/90-day growth

html-minimizer-webpack-plugin weekly downloads growth on npm: -54.3% over 7 days, -61.0% over 30 days, -55.4% over 90 days.html-minimizer-webpack-pluginWeekly downloads growth on npm6,292downloads / week now7-day growth-7,481 weekly downloads-54.3%30-day growth-9,852 weekly downloads-61.0%90-day growth-7,829 weekly downloads-55.4%Growth vs. nearest observation to each baseline date · Updated Oct 17, 2026pluginstats.com
html-minimizer-webpack-plugin weekly downloads growth on npm: -54.3% over 7 days, -61.0% over 30 days, -55.4% over 90 days.

Ranking history

html-minimizer-webpack-plugin npm ranking history: currently #1028 (by weekly downloads).html-minimizer-webpack-pluginnpm ranking · by weekly downloads · Last 90 days#1028current rank#1024#1025#1026#1027#1028#1029#1030Jul 21Aug 5Aug 20Sep 4Sep 19Oct 4Oct 19rankOct 18, 2026 – Oct 19, 2026 · 2 observations · Updated Oct 17, 2026pluginstats.com
html-minimizer-webpack-plugin npm ranking history: currently #1028 (by weekly downloads).

Listing placement

All npm2,256 listings · 113 pages · 1,130 shown · page 52, #8 (overall #1,028)
All npm: every listing in weekly downloads order

Listing placement

Webpack plugins247 listings · 13 pages · page 2, #9 (overall #29)
Webpack plugins: every listing in weekly downloads order

Filled points are observed values; hollow points come from Internet Archive snapshots of the listing page. Dashed segments span periods with no observations — values between points are not interpolated.

Each band is one page of 20. Weekly downloads on a linear scale. Placement is projected from weekly downloads, so it can differ from the marketplace's own sort order. Hover a dot to see the listing.

Recent observations

Full history (121)
Recent weekly downloads observations for html-minimizer-webpack-plugin
Date (UTC)Weekly downloadsChange vs. previous
6,292-981
7,273-575
7,848-3.2K
11,063-3K
14,0610
14,061+22
14,039+266
13,773+578
13,195+717
12,478-104
12,582+147
12,435-3.7K
16,154-1.4K
17,576—

Similar npm Webpack plugins plugins

All 20 html-minimizer-webpack-plugin alternatives

Data source

Weekly downloads (trailing 7 complete days) come from the official npm downloads API. Downloads include CI and mirrors and are not equivalent to installs or users. npm publishes no ratings.

Listing: https://www.npmjs.com/package/html-minimizer-webpack-plugin. First seen Oct 16, 2026; last successful collection Oct 19, 2026. See the methodology.