{"id":10410,"library":"rollup","title":"Rollup","description":"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.","status":"active","version":"4.60.1","language":"javascript","source_language":"en","source_url":"https://github.com/rollup/rollup","tags":["javascript","modules","bundler","bundling","es6","optimizer","typescript"],"install":[{"cmd":"npm install rollup","lang":"bash","label":"npm"},{"cmd":"yarn add rollup","lang":"bash","label":"yarn"},{"cmd":"pnpm add rollup","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"Rollup's programmatic API is primarily designed for ES Modules.","wrong":"const { rollup } = require('rollup');","symbol":"rollup","correct":"import { rollup } from 'rollup';"}],"quickstart":{"code":"import { rollup } from 'rollup';\nimport resolve from '@rollup/plugin-node-resolve';\nimport commonjs from '@rollup/plugin-commonjs';\n\nasync function build() {\n  const bundle = await rollup({\n    input: 'src/main.js',\n    plugins: [resolve(), commonjs()]\n  });\n\n  await bundle.write({\n    file: 'dist/bundle.js',\n    format: 'iife',\n    name: 'myBundle',\n    sourcemap: true\n  });\n\n  console.log('Bundle created successfully!');\n}\n\nbuild().catch(console.error);","lang":"typescript","description":"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."},"warnings":[{"fix":"Refactor plugins to avoid returning import attributes from `load` or `transform` hooks.","message":"Returning import attributes from `load` or `transform` hooks is deprecated and will not be supported in Rollup 5.","severity":"deprecated","affected_versions":">=4.57.0"},{"fix":"Ensure all generated asset and chunk paths remain within the configured output directory.","message":"Rollup now throws an error if the generated bundle contains paths that would escape the specified output directory.","severity":"breaking","affected_versions":">=4.59.0"},{"fix":"Upgrade your Node.js environment to version 18.0.0 or newer.","message":"Rollup requires Node.js v18.0.0 or higher.","severity":"gotcha","affected_versions":"<4.0.0"},{"fix":"Upgrade to Rollup v4.60.1 or higher to ensure all side effects are correctly preserved.","message":"Versions prior to 4.60.1 could incorrectly drop side effect imports due to a caching issue.","severity":"gotcha","affected_versions":"<4.60.1"}],"env_vars":null,"last_verified":"2026-04-18T00:00:00.000Z","next_check":"2026-07-17T00:00:00.000Z","problems":[{"fix":"Add the `--name \"myBundleName\"` option when using `output.format: 'umd'` or `rollup --format umd`.","cause":"The `umd` output format requires a global variable name for the bundle to attach to.","error":"Error: You must supply a name for UMD bundles"},{"fix":"Adjust your output configuration (`output.assetFileNames`, `output.chunkFileNames`) to ensure all paths are relative and contained within the `output.dir`.","cause":"Rollup's new validation prevents output files from being written outside the specified `output.dir`.","error":"Error: The generated bundle contains paths that would leave the output directory."},{"fix":"Install Rollup globally with `npm install --global rollup` or run it locally using `npx rollup`.","cause":"The Rollup CLI is not installed globally or not accessible in the current shell's PATH.","error":"rollup: command not found"}],"ecosystem":"npm"}