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 rollupVerified import paths — ran on the pinned version, not inferred.
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.
Refactor plugins to avoid returning import attributes from `load` or `transform` hooks.
Ensure all generated asset and chunk paths remain within the configured output directory.
Upgrade your Node.js environment to version 18.0.0 or newer.
Upgrade to Rollup v4.60.1 or higher to ensure all side effects are correctly preserved.
Add the `--name "myBundleName"` option when using `output.format: 'umd'` or `rollup --format umd`.
Adjust your output configuration (`output.assetFileNames`, `output.chunkFileNames`) to ensure all paths are relative and contained within the `output.dir`.
Install Rollup globally with `npm install --global rollup` or run it locally using `npx rollup`.
No dependency data recorded yet.