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.
npm install gulp-better-rollupVerified import paths — ran on the pinned version, not inferred.
Bundles ES6 modules from 'lib/index.js' using Rollup with Babel, generating a CommonJS output with inlined sourcemaps into the 'dist' directory.
Ensure `rollup` peer dependency is installed at `^1.4.1`. For modern Rollup versions, consider alternatives like `@rollup/stream` or other Gulp-Rollup integrations.
Remove the `input` option from the Rollup configuration object passed to `gulp-better-rollup`. Rely on `gulp.src()` for input files.
Remove the `sourcemap` option from Rollup configuration. Use `gulp-sourcemaps.init()` before `gulp-better-rollup` and `gulp-sourcemaps.write()` after it in the pipeline.
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.
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.
Consider inlining sourcemaps using `sourcemaps.write()` without arguments, or if external sourcemaps are essential, investigate alternative sourcemap generation or file extensions.
Remove the `input` property from the first argument (inputOptions) passed to the `rollup` plugin.
Remove the `sourcemap` option from the Rollup configuration. Integrate `gulp-sourcemaps` into your Gulp pipeline before and after `gulp-better-rollup`.
Run `npm install rollup@^1 --save-dev` to install the correct Rollup version.
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.