Jens Oliver Meiert

HTML Minifier Next: Even Faster, JavaScript Minification With SWC, SVG Minification

Published on Jan 6, 2026, filed under , . (Share this post, e.g. on Mastodon or on Bluesky.)

HTML Minifier Next (HMN) (the enhanced successor of HTML Minifier) has undergone many optimizations over the last months, including bug fixes, new features, and performance improvements.

Here are select changes since the last update, changes that make HMN even more versatile and useful:

Improved Performance Again

Performance has been an ongoing optimization goal, ever after investing in a larger, fairer, and more accurate comparison across minifiers.

From what I can tell from revising and running the internal regression tests is that HMN is now four to six times faster than it was when the project was restarted. HMN is already excellent in terms of features provided, but now it’s also competitive on speed.

(Minifier comparisons bring me to a point I’ll raise separately: Minifier performance is art and science, and there’s something the field could do to help here. More soon!)

Alternative JS Minifier Option (SWC)

Although Terser brings good JavaScript minification results, it’s not as fast as alternatives like SWC or Oxc.

As part of the push on better and better HMN performance, HMN now enables JS minifier switching—by specifying SWC as the “engine” for minifyJS, and installing it as a dependency, SWC can be used instead of Terser, though Terser would still be used for event handlers that SWC is not yet capable of processing.

New Out-of-the-Box SVG Minification

The HTML Minifier siblings handle SVG (and MathML) in just the most basic manner. This feels right for an HTML minifier—but as the entire family always handled CSS and JavaScript as well, and as other minifiers also offer some SVG support, HMN now ships with some more advanced SVG minification.

To use it, set minifySVG as true (CLI: --minify-svg). For fine-tuning, review the README section on SVG minification.

Refactoring in Preparation of HMN 5

Additionally, HMN is being audited and cleaned up in preparation for a major update with HMN 5, which will come with a bunch of DX and UX improvements. Subscribe to the thread if you like to follow along (or chime in)!

_ As you can tell, there’s even more to come—but this it for the latest updates for HML Minifier Next 🙂

About Me

Jens Oliver Meiert, on November 9, 2024.

I’m Jens (long: Jens Oliver Meiert), and I’m a senior engineering lead, guerrilla philosopher, and indie publisher. I’ve worked as a technical lead and engineering manager for companies you use every day and companies you’ve never heard of, I’m an occasional contributor to web standards (like HTML, CSS, WCAG), and I write and review books for O’Reilly and Frontend Dogma.

I love trying things, not only in web development and engineering management, but also in philosophy. Here on meiert.com I share some of my experiences and perspectives. (I value you being critical, interpreting charitably, and giving feedback.)