npm / terser
terser
What changed in terser 5, from its official release notes, upgrade guides and advisories. Sources checked 2026-10-19.
2 breaking1 security7 new APIs and options1 performance5 behavior and defaults12 fixes and other
See which of these apply to your code, ranked, in your agent:
npx @unstale/cli initterser 528 changes
Breaking changes 2
Terser no longer evaluates exponentiation of BigInt.
With property mangling enabled and keep_quoted set to strict, foo.bar and foo["bar"] are no longer considered equivalent.
Security 1
Terser produces
void 0instead ofundefinedbecause it is safer.
New APIs and options 7
Experimental support for stripping TypeScript types is available.
The ResizeObserver box option is added to domprops, affecting how it is handled by property mangling.
Terser now supports import defer syntax.
Terser now supports import source syntax.
Adds the builtins_ecma option.
Adds the builtins_pure option.
Adds Intl options to domprops.
Performance 1
Evaluation of method chains is no longer extremely slow or seemingly frozen.
Behavior and default changes 5
Terser parses identifiers from newer Unicode versions and escapes them for older runtimes.
The unused option now deletes computed keys of concise methods and getters/setters.
Parentheses are removed from comma expressions in computed property access.
The domprops list now includes observedAttributes, affecting property mangling when using that list.
More domprops were added, mostly related to Temporal, affecting property mangling when using that list.
Fixes and other changes 12
The fix for ambiguously scoped default args was rolled back due to issues without a clear reproduction.
Fixes transforming code in dynamic import arguments.
Functions that use argnames scope ambiguously are pinned (deoptimized), including when default arguments access other arguments or variables outside the function.
Fixes cases where the nullish coalescing operator is considered a boolean operator, causing booleans to be generated in its left side.
Fixed a crash when converting imports in the mozilla AST.
Fixed a crash related to dynamic import expressions.
Correctly parenthesizes tagged template strings when the tag is new something() so the emitted code is valid.
Fixes a crash when using mangle.keep_fnames with destructuring.
Error.cause is now included in the DOM properties list.
Extremely large floating-point number literals are parsed as
Infinity.Fixes bitwise optimization changing the result of && and ||.
Ensures var is extracted from a deleted default case.