Rollup JavaScript Module Bundler

Rollup JavaScript Module Bundler

github.com

1

About this website

Rollup is a free and open-source module bundler for JavaScript and TypeScript that specializes in producing efficient, tree-shaken bundles for libraries and applications. Created by Rich Harris (also the creator of Svelte) in 2015, Rollup pioneered ES module-based bundling and tree-shaking (dead code elimination), influencing subsequent tools including Webpack and esbuild. Key features: ES module native: Rollup was designed from the ground up to work with ES modules (import/export). Unlike earlier bundlers that relied on CommonJS (require/module.exports), Rollup processes ES modules natively, producing cleaner and more efficient output. Tree-shaking: Rollup's flagship feature. By analyzing the import/export graph, Rollup identifies and removes code that is imported but never used, resulting in significantly smaller bundles. This is especially valuable for library distribution. Output formats: Rollup can output bundles in multiple module formats including ESM (ES modules), CommonJS (CJS), UMD (Universal Module Definition), IIFE (Immediately Invoked Function Expression), AMD (Asynchronous Module Definition), and SystemJS. This makes it ideal for publishing libraries that need to support multiple environments. Plugins: Rollup's plugin system allows custom transformation and bundling logic. Popular plugins include @rollup/plugin-node-resolve (resolve bare module specifiers from node_modules), @rollup/plugin-commonjs (convert CommonJS modules to ES modules), @rollup/plugin-babel, @rollup/plugin-typescript, @rollup/plugin-json, @rollup/plugin-alias, and @rollup/plugin-replace. Code splitting: split bundles into smaller chunks loaded on demand via dynamic imports. Configuration via rollup.config.js or programmatically. Watch mode: rebuild bundles on file changes during development. Source maps for debugging. Used by Vite, SvelteKit, D3, Three.js, and many other major libraries. JavaScript. MIT.

Tags & Categories

Tags

Statistics

1
Views
0
Clicks
0
Like
0
Dislike

Comments

Log In to post a comment

No comments yet. Be the first!