{"id":21412,"library":"gulp-rollup-2","title":"gulp-rollup-2","description":"gulp-rollup-2 v2.1.0 is a modern Gulp plugin for Rollup 3.x/4.x, providing native Rollup API integration in Gulp pipelines. It features production-grade caching with object-hash for stable incremental builds, automatic duplicate output detection, memory-safe bundle cleanup, and intelligent sourcemap handling. Supports multiple output formats (ES, CJS, UMD, IIFE, AMD, System) and dual modes (pipe or standalone src). Actively maintained with monthly releases.","status":"active","version":"2.1.0","language":"javascript","source_language":"en","source_url":"https://github.com/orcunsaltik/gulp-rollup-2","tags":["javascript","gulp","gulpplugin","rollup","rollup4","module","modules","bundler","tree-shaking"],"install":[{"cmd":"npm install gulp-rollup-2","lang":"bash","label":"npm"},{"cmd":"yarn add gulp-rollup-2","lang":"bash","label":"yarn"},{"cmd":"pnpm add gulp-rollup-2","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Peer dependency - requires Gulp >=4.0.0 for pipe() integration","package":"gulp","optional":false},{"reason":"Peer dependency - core bundler, requires Rollup >=4.0.0","package":"rollup","optional":false}],"imports":[{"note":"Package exports a CommonJS default; ESM import may work if bundler supports package.json exports, but CJS require is guaranteed.","wrong":"import rollup2 from 'gulp-rollup-2';","symbol":"default","correct":"const rollup2 = require('gulp-rollup-2');"},{"note":"Named export `rollup` is the main plugin function. No `.default` needed.","wrong":"const { rollup } = require('gulp-rollup-2').default;","symbol":"rollup","correct":"const { rollup } = require('gulp-rollup-2');"},{"note":"Standalone src() factory for when gulp.src() is not used. Same result as named destructuring.","wrong":"const src = require('gulp-rollup-2').src;","symbol":"src","correct":"const { src } = require('gulp-rollup-2');"}],"quickstart":{"code":"const gulp = require('gulp');\nconst rollup2 = require('gulp-rollup-2');\nconst resolve = require('@rollup/plugin-node-resolve');\nconst commonjs = require('@rollup/plugin-commonjs');\n\ngulp.task('bundle', () =>\n  gulp\n    .src('src/index.js')\n    .pipe(\n      rollup2.rollup({\n        input: 'src/index.js',\n        plugins: [resolve(), commonjs()],\n        output: {\n          file: 'bundle.js',\n          format: 'iife',\n          name: 'App',\n          sourcemap: true,\n        },\n      })\n    )\n    .pipe(gulp.dest('dist'))\n);","lang":"javascript","description":"Basic Gulp task using gulp-rollup-2 to bundle src/index.js with Rollup plugins and output IIFE with sourcemap."},"warnings":[{"fix":"Upgrade Node.js to LTS version 18+.","message":"Node.js >= 18.0.0 required. Older versions (16.x or below) are not supported.","severity":"breaking","affected_versions":"<18.0.0"},{"fix":"Install rollup@^4.0.0.","message":"Rollup >=4.0.0 required. Rollup 3.x may work but is untested.","severity":"breaking","affected_versions":"<4.0.0"},{"fix":"Ensure each output has a distinct `file` path.","message":"Output files must be unique; duplicate outputs throw an error.","severity":"gotcha","affected_versions":">=2.0.0"},{"fix":"Set `cache: false` in options if plugins have side effects.","message":"When using watch mode, caching may not re-trigger if only transitive dependencies change; consider disabling cache for dynamic plugins.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Replace with gulp-rollup-2 and update API calls.","message":"gulp-rollup and rollup-stream are legacy packages; migrate to gulp-rollup-2.","severity":"deprecated","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-04-27T00:00:00.000Z","next_check":"2026-07-26T00:00:00.000Z","problems":[{"fix":"Ensure each output object has a unique `file` value, e.g., 'bundle.esm.js' and 'bundle.cjs.js'.","cause":"Multiple rollup output configurations target the same `file` path.","error":"Error: Output files must be unique. Duplicate outputs detected: ..."},{"fix":"Use `const { rollup } = require('gulp-rollup-2');` (destructured named export).","cause":"Incorrect import - trying to call default export as function or using wrong named import.","error":"TypeError: rollup2.rollup is not a function"},{"fix":"Run `npm install --save-dev rollup@^4.0.0`.","cause":"Rollup is not installed as a peer dependency.","error":"Error: Cannot find module 'rollup'"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}