{"id":13267,"library":"gulp-better-rollup","title":"Gulp Better Rollup Plugin","description":"gulp-better-rollup is a Gulp plugin designed to integrate the Rollup ES6 module bundler into a Gulp build pipeline. Released with its last stable version 4.0.1 in March 2019, it relies on Rollup `^1.4.1` as a peer dependency. This makes it incompatible with Rollup versions 2, 3, and the current major version 4, which has seen active development since then. Its key differentiator compared to the older `gulp-rollup` is a deeper integration with Gulp's stream, where it processes file paths from `gulp.src()` rather than in-memory buffers. This approach aims to give developers more control over the Gulp pipeline, but comes with specific caveats regarding pre-processing plugins and Rollup option handling. Given its last update date and peer dependency on a significantly older Rollup version, its release cadence is non-existent, and it is effectively superseded by other approaches for modern Rollup usage.","status":"abandoned","version":"4.0.1","language":"javascript","source_language":"en","source_url":"git://github.com/MikeKovarik/gulp-better-rollup","tags":["javascript","gulp","gulpplugin","rollup","es6"],"install":[{"cmd":"npm install gulp-better-rollup","lang":"bash","label":"npm"},{"cmd":"yarn add gulp-better-rollup","lang":"bash","label":"yarn"},{"cmd":"pnpm add gulp-better-rollup","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Core bundler, required as a peer dependency. Only compatible with Rollup `^1.4.1`. Modern Rollup versions (2.x, 3.x, 4.x) are incompatible.","package":"rollup","optional":false}],"imports":[{"note":"This package is CommonJS-only and not designed for direct ESM import. Node.js `require` is the correct way.","wrong":"import rollup from 'gulp-better-rollup';","symbol":"rollup","correct":"const rollup = require('gulp-better-rollup');"},{"note":"Standard Gulp plugin usage employs CommonJS `require`.","symbol":"gulp","correct":"const gulp = require('gulp');"},{"note":"Rollup plugins like babel are typically required separately and passed into `gulp-better-rollup`'s options.","symbol":"babel","correct":"const babel = require('rollup-plugin-babel');"}],"quickstart":{"code":"const gulp = require('gulp');\nconst sourcemaps = require('gulp-sourcemaps');\nconst rollup = require('gulp-better-rollup');\nconst babel = require('rollup-plugin-babel');\n\ngulp.task('lib-build', () => {\n  return gulp.src('lib/index.js')\n    .pipe(sourcemaps.init())\n    .pipe(rollup({\n      // The 'input' option is handled by gulp.src() and unsupported here.\n      plugins: [babel()]\n    }, {\n      // The 'sourcemap' option is unsupported; use gulp-sourcemaps instead.\n      format: 'cjs'\n    }))\n    // Inlining the sourcemap into the exported .js file\n    .pipe(sourcemaps.write())\n    .pipe(gulp.dest('dist'));\n});","lang":"javascript","description":"Bundles ES6 modules from 'lib/index.js' using Rollup with Babel, generating a CommonJS output with inlined sourcemaps into the 'dist' directory."},"warnings":[{"fix":"Ensure `rollup` peer dependency is installed at `^1.4.1`. For modern Rollup versions, consider alternatives like `@rollup/stream` or other Gulp-Rollup integrations.","message":"This plugin is only compatible with Rollup `^1.4.1`. It does not support Rollup versions 2.x, 3.x, or the current 4.x. Attempting to use it with newer Rollup versions will lead to breakage.","severity":"breaking","affected_versions":">=4.0.1"},{"fix":"Remove the `input` option from the Rollup configuration object passed to `gulp-better-rollup`. Rely on `gulp.src()` for input files.","message":"The Rollup `input` option is explicitly unsupported by `gulp-better-rollup`. The input file is determined by `gulp.src()`.","severity":"breaking","affected_versions":">=4.0.1"},{"fix":"Remove the `sourcemap` option from Rollup configuration. Use `gulp-sourcemaps.init()` before `gulp-better-rollup` and `gulp-sourcemaps.write()` after it in the pipeline.","message":"Rollup's native `sourcemap` option is unsupported. Source map generation must be handled by `gulp-sourcemaps`.","severity":"breaking","affected_versions":">=4.0.1"},{"fix":"Place `gulp-better-rollup` early in the Gulp pipeline if file content transformations are expected. Ensure preceding plugins do not modify file contents if their output is critical.","message":"If other Gulp plugins are used before `gulp-better-rollup` that perform source transformations, those transformations will be lost, as `gulp-better-rollup` processes file paths directly, bypassing previous buffer modifications.","severity":"gotcha","affected_versions":">=4.0.1"},{"fix":"Control the output file name and path primarily through `gulp.dest()` and `gulp-rename` if necessary, rather than relying on Rollup's `output.file` option.","message":"The Rollup output `file` option is largely ignored or overridden. The output location is determined by `gulp.dest()`. If a full directory path is passed to Rollup's `file` option, only the file name part will be used. If `gulp.dest()` specifies a file path, Rollup's `file` argument is ignored entirely.","severity":"gotcha","affected_versions":">=4.0.1"},{"fix":"Consider inlining sourcemaps using `sourcemaps.write()` without arguments, or if external sourcemaps are essential, investigate alternative sourcemap generation or file extensions.","message":"When using `gulp-sourcemaps` with `.mjs` extension files, the plugin may not insert the `//# sourceMappingURL=` linking comment, rendering external sourcemaps effectively useless for debugging.","severity":"gotcha","affected_versions":">=4.0.1"}],"env_vars":null,"last_verified":"2026-04-19T00:00:00.000Z","next_check":"2026-07-18T00:00:00.000Z","problems":[{"fix":"Remove the `input` property from the first argument (inputOptions) passed to the `rollup` plugin.","cause":"Attempting to specify the `input` option in the Rollup configuration object, which is handled by `gulp.src()`.","error":"RollupError: You must supply an `input` option."},{"fix":"Remove the `sourcemap` option from the Rollup configuration. Integrate `gulp-sourcemaps` into your Gulp pipeline before and after `gulp-better-rollup`.","cause":"Setting Rollup's `sourcemap` option directly in `gulp-better-rollup`'s configuration.","error":"Error: Rollup's 'sourcemap' option is not supported. Use 'gulp-sourcemaps' plugin instead."},{"fix":"Run `npm install rollup@^1 --save-dev` to install the correct Rollup version.","cause":"The `rollup` peer dependency is either not installed or an incompatible version is installed (e.g., Rollup 2.x, 3.x, or 4.x).","error":"Error: Cannot find module 'rollup'"},{"fix":"Examine the reported file and line number for JavaScript syntax errors. For better error reporting, consider using `rollup-plugin-terser` or similar plugins that can provide more detailed output, or debug with a pure Rollup setup first.","cause":"Syntax error in source code, but `gulp-better-rollup`'s error reporting is less verbose than standalone Rollup.","error":"Unexpected token (xx:yy) in file.js"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":"","cli_version":null}