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 Fresh · Dec 6, 2026

html-minimizer-webpack-plugin has 9,992 recorded weekly downloads on npm, a decrease of 34.8% over the past 30 days, ranking #1258 of 3,247 tracked listings.

Weekly downloads
9,992
Official API · Dec 5, 2026
7-day growth
-8.7%
-949 weekly downloads
30-day growth
-34.8%
-5.3K weekly downloads
90-day growth
-15.3%
-1.8K weekly downloads
Rank
#1258
▼ 56 in 7 days

About html-minimizer-webpack-plugin

<div align="center"> <a href="https://github.com/webpack/webpack"> <img width="200" height="200" src="https://webpack.js.org/assets/icon-square-big.svg"> </a> </div>

[![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:

npm install html-minimizer-webpack-plugin --save-dev

or

yarn add -D html-minimizer-webpack-plugin

or

pnpm add -D html-minimizer-webpack-plugin

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

npm install @swc/html --save-dev

or

yarn add -D @swc/html

or

pnpm add -D @swc/html

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

npm install @minify-html/node --save-dev

or

yarn add -D @minify-html/node

or

pnpm add -D @minify-html/node

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

webpack.config.js

const CopyPlugin = require("copy-webpack-plugin");
const HtmlMinimizerPlugin = require("html-minimizer-webpack-plugin");

module.exports = {
  module: {
    rules: [
      {
        test: /\.html$/i,
        type: "asset/resource",
      },
    ],
  },
  plugins: [
    new CopyPlugin({
      patterns: [
        {
          context: path.resolve(__dirname, "dist"),
          from: "./src/*.html",
        },
      ],
    }),
  ],
  optimization: {
    minimize: true,
    minimizer: [
      // For webpack@5 you can use the `...` syntax to extend existing minimizers (i.e. `terser-webpack-plugin`), uncomment the next line
      // `...`

      // For `html-minifier-terser`:
      //
      new HtmlMinimizerPlugin(),

      // For `@swc/html`:
      //
      // HTML documents - HTML documents with `Doctype` and `<html>/`<head>`/`<body>` tags
      //
      // Options - https://github.com/swc-project/bindings/blob/main/packages/html/index.ts#L5
      //
      // new HtmlMinimizerPlugin({
      //   minify: HtmlMinimizerPlugin.swcMinify,
      //   minimizerOptions: {}
      // })
      //
      //
      // HTML fragments - HTML fragments, i.e. HTML files without doctype or used in `<template></template>` tags or HTML parts which injects into another HTML parts
      //
      // Options - https://github.com/swc-project/bindings/blob/main/packages/html/index.ts#L38
      //
      // new HtmlMinimizerPlugin({
      //   minify: HtmlMinimizerPlugin.swcMinifyFragment,
      //   minimizerOptions: {}
      // })
    ],
  },
};

[!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 - <meta>/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

Type:

type test = string | RegExp | (string | RegExp)[];

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

Test to match files against.

module.exports = {
  optimization: {
    minimize: true,
    minimizer: [
      new HtmlMinimizerPlugin({
        test: /\.foo\.html/i,
      }),
    ],
  },
};
include

Type:

type include = string | RegExp | (string | RegExp)[];

Default: undefined

Files to include for minification.

webpack.config.js

module.exports = {
  optimization: {
    minimize: true,
    minimizer: [
      new HtmlMinimizerPlugin({
        include: /\/includes/,
      }),
    ],
  },
};
exclude

Type:

type exclude = string | RegExp | (string | RegExp)[];

Default: undefined

Files to exclude from minification.

webpack.config.js

module.exports = {
  optimization: {
    minimize: true,
    minimizer: [
      new HtmlMinimizerPlugin({
        exclude: /\/excludes/,
      }),
    ],
  },
};
parallel

Type:

type parallel = undefined | boolean | number;

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…

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: 9,992 weekly downloads as of Dec 5, 2026, -15.3% over 90 days.html-minimizer-webpack-pluginWeekly downloads on npm · Last 90 days9,992downloads / week-15.3% over 90 days05K10K15K20KSep 6Sep 21Oct 6Oct 21Nov 5Nov 20Dec 5downloads / weekobservedarchived (Internet Archive)no observationsSep 7, 2026 – Dec 5, 2026 · 90 observations · Updated Dec …pluginstats.com
html-minimizer-webpack-plugin weekly downloads on npm, last 90 days: 9,992 weekly downloads as of Dec 5, 2026, -15.3% over 90 days.

7/30/90-day growth

html-minimizer-webpack-plugin weekly downloads growth on npm: -8.7% over 7 days, -34.8% over 30 days, -15.3% over 90 days.html-minimizer-webpack-pluginWeekly downloads growth on npm9,992downloads / week now7-day growth-949 weekly downloads-8.7%30-day growth-5,337 weekly downloads-34.8%90-day growth-1,806 weekly downloads-15.3%Growth vs. nearest observation to each baseline date · Updated Dec 5, 2026pluginstats.com
html-minimizer-webpack-plugin weekly downloads growth on npm: -8.7% over 7 days, -34.8% over 30 days, -15.3% over 90 days.

Ranking history

html-minimizer-webpack-plugin npm ranking history: currently #1258 (by weekly downloads).html-minimizer-webpack-pluginnpm ranking · by weekly downloads · Last 90 days#1258current rank#950#1000#1050#1100#1150#1200#1250#1300#1350Sep 7Sep 22Oct 7Oct 22Nov 6Nov 21Dec 6rankOct 18, 2026 – Dec 6, 2026 · 44 observations · Updated Dec 5, 2026pluginstats.com
html-minimizer-webpack-plugin npm ranking history: currently #1258 (by weekly downloads).

Listing placement

All npm3,247 listings · 163 pages · 1,083 shown · page 63, #18 (overall #1,258)
All npm: every listing in weekly downloads order

Listing placement

Webpack plugins349 listings · 18 pages · page 2, #12 (overall #32)
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 (170)
Recent weekly downloads observations for html-minimizer-webpack-plugin
Date (UTC)Weekly downloadsChange vs. previous
9,992-31
10,023-15
10,038-440
10,478-504
10,982+253
10,729-69
10,798-143
10,941-595
11,536-37
11,573+602
10,971+566
10,405+947
9,458+442
9,016—

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 Dec 6, 2026. See the methodology.