gulp-rollup-stream

raw JSON →
0.2.0 verified Mon Apr 27 auth: no javascript deprecated

Gulp plugin that integrates Rollup bundling into Gulp pipelines, version 0.2.0 (last released ~2016). It allows using Gulp's streaming file system with Rollup's module bundling, supporting options like cache, external modules, plugins, and output formats (esm, cjs, iife, umd). The package is extremely minimal and does not handle sourcemaps or modern Rollup APIs. It is not actively maintained and lacks support for newer Rollup versions. Compared to alternatives like gulp-better-rollup, this package has a simpler API but fewer features.

error Cannot find module 'gulp-rollup-stream'
cause Package not installed or not in node_modules.
fix
Run 'npm install gulp-rollup-stream --save-dev' (note: deprecated, consider alternatives).
error TypeError: rollup is not a function
cause Incorrect import: likely using named import when default import is needed.
fix
Use 'import rollup from "gulp-rollup-stream"' or 'const rollup = require("gulp-rollup-stream")'.
error Error: Could not load ... (imported by ...): The plugin is not compatible with Rollup 1.x+
cause Using a newer version of Rollup (>=1.0) which changed the plugin API.
fix
Downgrade Rollup to 0.x or switch to a plugin that supports modern Rollup.
deprecated Package uses outdated Rollup API (pre-1.0). Does not support Rollup 1.x+ or ES modules in input.
fix Upgrade to a maintained plugin like gulp-better-rollup or gulp-rollup.
breaking Sourcemaps are not supported. Output files will not have sourcemaps even if Rollup produces them.
fix Use a different plugin that supports sourcemaps, or add gulp-sourcemaps with careful handling.
gotcha The 'cache' option expects a Rollup bundle object, not a boolean. Setting cache: true will silently fail.
fix Pass a valid cache object obtained from a previous bundle via the bundleCb callback.
deprecated No activity or maintenance since 2016. Known incompatibilities with Node.js versions >10.
fix Switch to an actively maintained plugin.
npm install gulp-rollup-stream
yarn add gulp-rollup-stream
pnpm add gulp-rollup-stream

Basic Gulp task that bundles src/main.js into dist/main.js using Rollup with CommonJS output format.

const gulp = require('gulp');
const rollup = require('gulp-rollup-stream');
const { pipeline } = require('stream');

gulp.task('rollup', () => {
  return gulp.src('src/main.js')
    .pipe(rollup({
      format: 'cjs',
      cache: true
    }))
    .pipe(gulp.dest('dist'));
});