How to Switch From HTML Minifier Next 9 to HTML Minifier 5
Published on Nov 3, 2026, filed under tools, development, html, performance, optimization. (Share this post, e.g., on Mastodon.)
HTML Minifier Next (HMN) is going back to the roots, replacing the original HTML Minifier (HM) effectively now! With this consolidation, if you’re using HMN, it’s best to switch to HM. HM 5.0.0 matches HMN 9.1.1—same options, same output—so switching is mostly a matter of renaming. (HMN will be around for a moment, but I tend to be quick and will eventually deprecate HMN in favor of HM.)
Here’s a quick checklist, which assumes you’re on the latest version of HMN (if you’re not, first follow the HMN changelog to update to HMN 9.1.1):
Package: If you installed HMN, replace it (e.g.,
npm uninstall html-minifier-next && npm i -D html-minifier).Imports: If you use HMN programmatically, change
from 'html-minifier-next'tofrom 'html-minifier'.Command: If you use HMN on the command line, use
html-minifierinstead ofhtml-minifier-next, andhminstead ofhmn(e.g.,npx html-minifier --zero;hmworks once HM is installed).Config file: If you use html-minifier-next.config.json or htmlminifier.config.json, rename it to html-minifier.config.json—HM does not pick up the old file, and will not tell you.
JSON Schema: If you reference the schema in your config file, update
$schematohttps://raw.githubusercontent.com/j9t/html-minifier/main/html-minifier.schema.json(or ./node_modules/html-minifier/html-minifier.schema.json).Cache sizes: If you set
HMN_CACHE_CSS,HMN_CACHE_JS, orHMN_CACHE_SVG, rename them toHM_CACHE_CSS,HM_CACHE_JS, andHM_CACHE_SVG.Warnings and errors: If you filter HMN’s output or errors, note that warnings and error messages now start with “HTML Minifier:” (instead of “HTML Minifier Next:”), and that the error code for a minifier dependency that fails to load is
HM_MISSING_DEPENDENCY(instead ofHMN_MISSING_DEPENDENCY).
This should be everything. As always, if you run into any problems, please file an issue! (Note that I might need to prioritize my sponsors for help requests.)
Finally, thank you for using HMN—if you like HMN/HM as a powerful HTML optimization tool, spread the word and consider supporting the work on it!
About Me
I’m Jens (long: Jens Oliver Meiert), and I’m an engineering lead, guerrilla philosopher, and indie publisher. I’ve worked as a technical lead and manager at various companies (e.g., Google); I’m an active web and tool developer (code optimization, digital defense), a contributor to web standards (like HTML, CSS, WCAG), and a book author (O’Reilly, Frontend Dogma). Stay in touch.
