npm / terser-webpack-plugin
terser-webpack-plugin
What changed in terser-webpack-plugin 5, from its official release notes, upgrade guides and advisories. Sources checked 2026-10-17.
3 deprecations5 new APIs and options1 performance2 behavior and defaults3 fixes and other
See which of these apply to your code, ranked, in your agent:
npx @unstale/cli initterser-webpack-plugin 514 changes
Deprecations 3
The project recommends switching to minimizer-webpack-plugin, a single plugin for minification that merges other minimizers and supports different minifier types in one instance.
minimizerOptions replaces terserOptions; terserOptions remains available as a deprecated alias.
terserOptions is deprecated in favor of minimizerOptions but remains available as an alias.
New APIs and options 5
Built-in CSS minimizers from css-minimizer-webpack-plugin are available in the plugin.
Minimizers gain a filter method, allowing one plugin instance to handle multiple asset types.
Built-in HTML minimizers from html-minimizer-webpack-plugin are available in the plugin.
The minify option now supports an array of minimizers, allowing multiple minimizers to be configured.
Adds the ability to minimize JSON using jsonMinify.
Performance 1
Deduplicating extracted comments now takes linear time, keeping builds fast when an asset contains many distinct preserved comments.
Behavior and default changes 2
The terserOptions option now supports an array of minimizers.
extractComments is now supported with swcMinify, allowing comments to be extracted when using the SWC minifier.
Fixes and other changes 3
Fixes handling of empty files.
Errors and warnings from a minimizer are respected when it returns no code.
Errors are caught when loading minimizers.