unstale

npm / terser-webpack-plugin

terser-webpack-plugin

What changed in terser-webpack-plugin 2 to 5, from its official release notes, upgrade guides and advisories. Sources checked 2026-11-30.

15 breaking3 deprecations5 new APIs and options2 performance7 behavior and defaults1 tooling5 fixes and other

See which of these apply to your code, ranked, in your agent:

npx @unstale/cli init

@unstale/cli on npm

terser-webpack-plugin 519 changes

Breaking changes 4

  • The cache option was removed; the plugin respects webpack's cache option by default.

    5.0.0release notes

  • The cacheKeys option was removed; the plugin respects webpack's cache option by default.

    5.0.0release notes

  • The sourceMap option was removed; the plugin respects webpack's devtool option by default.

    5.0.0release notes

  • webpack 4 is no longer supported.

    5.0.0release notes

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.

    5.6.0release notes

  • minimizerOptions replaces terserOptions; terserOptions remains available as a deprecated alias.

    5.6.0release notes

  • terserOptions is deprecated in favor of minimizerOptions but remains available as an alias.

    5.6.0release notes

New APIs and options 5

  • Built-in CSS minimizers from css-minimizer-webpack-plugin are available in the plugin.

    5.6.0release notes

  • Minimizers gain a filter method, allowing one plugin instance to handle multiple asset types.

    5.6.0release notes

  • Built-in HTML minimizers from html-minimizer-webpack-plugin are available in the plugin.

    5.6.0release notes

  • The minify option now supports an array of minimizers, allowing multiple minimizers to be configured.

    5.6.0release notes

  • Adds the ability to minimize JSON using jsonMinify.

    5.4.0release notes

Performance 2

  • Deduplicating extracted comments now takes linear time, keeping builds fast when an asset contains many distinct preserved comments.

    5.6.1release notes

  • A performance improvement was made.

    5.0.0release notes

Behavior and default changes 2

  • The terserOptions option now supports an array of minimizers.

    5.6.0release notes

  • extractComments is now supported with swcMinify, allowing comments to be extracted when using the SWC minifier.

    5.5.0release notes

Fixes and other changes 3

  • Fixes handling of empty files.

    5.3.16release notes

  • Errors and warnings from a minimizer are respected when it returns no code.

    5.3.15release notes

  • Errors are caught when loading minimizers.

    5.3.15release notes

terser-webpack-plugin 44 changes

Breaking changes 3

  • The minify option's return value changed; only code, map, and extractedComments are valid.

    4.0.0release notes

  • The terser version is now 5.

    4.0.0release notes

  • The warningsFilter option was removed without replacement.

    4.0.0release notes

Fixes and other changes 1

terser-webpack-plugin 36 changes

Breaking changes 4

  • The chunkFilter option was removed; use test, include, or exclude options instead.

    3.0.0release notes

  • A filename that conflicts with existing assets now causes an error instead of a warning.

    3.0.0release notes

  • The minimum supported Node.js version is now 10.13.

    3.0.0release notes

  • The callback arguments are now ordered file, warning, source instead of warning, file, source.

    3.0.0release notes

Behavior and default changes 1

  • When filename is a function, it receives one object argument with filename, basename, query, and hash properties.

    3.0.0release notes

Tooling 1

terser-webpack-plugin 29 changes

Breaking changes 4

  • When extractComments.condition is true, only some comments are extracted.

    2.0.0release notes

  • The extractComments option is enabled by default.

    2.0.0release notes

  • The minimum required Node.js version is 8.9.0.

    2.0.0release notes

  • The sourceMap option now defaults to depending on the Webpack devtool option.

    2.0.0release notes

Behavior and default changes 4

Fixes and other changes 1