Home

Terser

Terser is an open-source JavaScript minifier and compressor used to reduce the size of JavaScript files for production. It is designed as a drop-in replacement for UglifyJS2 and focuses on compatibility with modern JavaScript features while improving performance and stability. Terser parses code into an abstract syntax tree, applies optimizations, and outputs compact JavaScript that preserves original semantics.

Core features include ES2015+ parsing and output, variable name mangling, dead-code elimination, constant folding, function inlining

Usage: Terser is commonly installed via npm and used in build workflows. It can be run from

History and development: Terser originated as a fork of UglifyJS2 to address maintenance and compatibility with

where
safe,
and
control-flow
optimizations.
It
supports
source
maps,
preservation
of
license
comments,
and
fine-grained
options
to
control
compression
and
mangling.
It
also
offers
configuration
to
customize
how
aggressively
code
is
minimized
and
how
top-level
or
property
names
are
mangled.
the
command
line
or
via
a
programmatic
API.
It
is
widely
integrated
with
build
tools
such
as
Webpack
(via
terser-webpack-plugin)
and
Rollup
(via
terser
plugin),
among
others,
to
replace
older
minifiers.
newer
JavaScript
syntax.
It
has
since
developed
independently
with
ongoing
updates
and
community
support.