Skip to content
TelegramWhatsApp

Dictionary

Rollup

Rollup is a module bundler for JavaScript that specializes in producing optimized, smaller bundles particularly for libraries and packages. It pioneered tree-shaking, the process of eliminating unused code from the final bundle by analyzing ES module import and export statements statically, resulting in significantly smaller output compared to bundlers that include entire modules regardless of what is actually used.

Rollup outputs clean ES module code by default, which is important for library authors who want their packages to be tree-shakeable by downstream consumers. When a library is bundled with Rollup and published as ES modules, applications that import only specific functions can eliminate the rest during their own build step. Vite uses Rollup under the hood for production builds, and many popular open-source libraries rely on it for their distribution bundles. For application bundling with complex needs like code splitting and hot module replacement, tools like Webpack or Vite are typically more appropriate, but for library packaging Rollup remains the standard choice.