Registry / devops / rollup

rollup

JSON →
library4.60.1jsnpmunverified

Rollup is a next-generation ES module bundler that compiles small pieces of code into larger, more complex libraries or applications. It uses the standardized ES module format, allowing for efficient tree-shaking and optimized bundles. The current stable version is 4.60.1, and it maintains an active release cadence with frequent bug fixes and minor feature additions.

npm install rollup
INSTALL
IMPORT
SIG · ROLLUP
R
rollup
devopsjavascriptv4.60.1
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

rollup
import { rollup } from 'rollup';
const { rollup } = require('rollup');
Rollup's programmatic API is primarily designed for ES Modules.

This quickstart demonstrates using Rollup's JavaScript API to bundle an entry file (`src/main.js`) into an immediately invoked function expression (IIFE) for browser usage, including sourcemaps and common plugins for resolving Node.js modules and converting CommonJS.

import { rollup } from 'rollup'; import resolve from '@rollup/plugin-node-resolve'; import commonjs from '@rollup/plugin-commonjs'; async function build() { const bundle = await rollup({ input: 'src/main.js', plugins: [resolve(), commonjs()] }); await bundle.write({ file: 'dist/bundle.js', format: 'iife', name: 'myBundle', sourcemap: true }); console.log('Bundle created successfully!'); } build().catch(console.error);
rollup --version
Debug
Known issues
deprecatedReturning import attributes from `load` or `transform` hooks is deprecated and will not be supported in Rollup 5.
fix
Refactor plugins to avoid returning import attributes from `load` or `transform` hooks.
affects: >=4.57.0
breakingRollup now throws an error if the generated bundle contains paths that would escape the specified output directory.
fix
Ensure all generated asset and chunk paths remain within the configured output directory.
affects: >=4.59.0
gotchaRollup requires Node.js v18.0.0 or higher.
fix
Upgrade your Node.js environment to version 18.0.0 or newer.
affects: <4.0.0
gotchaVersions prior to 4.60.1 could incorrectly drop side effect imports due to a caching issue.
fix
Upgrade to Rollup v4.60.1 or higher to ensure all side effects are correctly preserved.
affects: <4.60.1
Errors
Common errors & fixes
Error: You must supply a name for UMD bundles
The `umd` output format requires a global variable name for the bundle to attach to.
fix
Add the `--name "myBundleName"` option when using `output.format: 'umd'` or `rollup --format umd`.
Error: The generated bundle contains paths that would leave the output directory.
Rollup's new validation prevents output files from being written outside the specified `output.dir`.
fix
Adjust your output configuration (`output.assetFileNames`, `output.chunkFileNames`) to ensure all paths are relative and contained within the `output.dir`.
rollup: command not found
The Rollup CLI is not installed globally or not accessible in the current shell's PATH.
fix
Install Rollup globally with `npm install --global rollup` or run it locally using `npx rollup`.
Upgrade
Version history
4.60.1latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
2 hits · last 30 days
node
2
Resources
rollup — npm install rollup · libregistry