Home

rollup

Rollup is an open-source JavaScript module bundler designed to produce small, optimized bundles from multiple ES modules. It is particularly well suited for building libraries and applications where code size and predictable output matter. Rollup analyzes the import and export statements across a project's modules to build a dependency graph and generate a single bundled file or a set of bundles.

A core feature of Rollup is tree-shaking, which removes unused code by leveraging the static structure of

Rollup is configured via a rollup.config.js file that specifies input files, output options, and a plugins array.

Historically, Rollup was created by Rich Harris and has since grown a community-driven ecosystem. It is widely

ES
modules.
This
often
results
in
smaller
bundles
compared
to
other
bundlers.
Rollup
can
emit
bundles
in
several
formats,
including
ES
module
(esm),
CommonJS
(cjs),
UMD,
and
IIFE,
and
supports
code
splitting
through
multiple
entry
points
and
dynamic
imports.
It
also
preserves
the
original
module
boundaries
in
the
output
when
possible,
aiding
library
authors
who
want
clear
and
tree-shaken
APIs.
The
plugin
system
extends
Rollup’s
capabilities
to
handle
non-JavaScript
assets,
transpile
code,
or
transform
modules.
Common
plugins
provide
support
for
resolving
node
modules,
converting
CommonJS
modules
to
ES
modules,
Babel
transpilation,
and
minification
with
terser.
Rollup
also
supports
sourcemaps
and
various
output
configurations
to
suit
different
environments.
used
by
JavaScript
libraries
and
projects
that
prioritize
small,
predictable
bundles,
with
notable
adoption
in
projects
such
as
Svelte's
tooling.
While
it
competes
with
Webpack
in
broader
application
bundling,
Rollup
is
often
favored
for
library
distribution
due
to
its
efficient
tree-shaking
and
straightforward
output
formats.