Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
muslnode 18–223 runs
build_error
glibcnode 18–223 runs
build_error
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
default (rollupStream)
✓ import rollupStream from 'rollup-stream';
✗ const rollup = require('rollup-stream');
Package provides a default export, not named. Use default import or destructure from default.
bundle event
✓ const stream = rollupStream(options); stream.on('bundle', (bundle) => { cache = bundle; })
✗ rollupStream(options).on('bundle', ...) with arrow function returning it – the event is only emitted once.
The 'bundle' event is emitted after bundling, prior to streaming. Cache must be passed in options and updated here.
source plugin usage
✓ const source = require('vinyl-source-stream'); rollupStream(options).pipe(source('output.js'))
✗ rollupStream(options).pipe(fs.createWriteStream('out')) – it expects vinyl pipes, not raw streams.
Must use vinyl-source-stream to convert the emitted stream into a vinyl file object for Gulp.
Bundle with Rollup via Gulp using rollup-stream, converting the readable stream to a vinyl file.
const gulp = require('gulp');
const rollupStream = require('rollup-stream');
const source = require('vinyl-source-stream');
gulp.task('bundle', function() {
return rollupStream({
input: './src/main.js'
})
.pipe(source('app.js'))
.pipe(gulp.dest('./dist'));
});
Errors
Common errors & fixes
Error: Cannot find module 'rollup'
rollup is a peer dependency; not installed automatically.
fixnpm install rollup@0.68.2 (or any 0.x version)
TypeError: rollupStream is not a function
Default import/require mishandled – package exports default, not named.
fixconst rollupStream = require('rollup-stream').default; or use ES import with default. The "path" argument must be of type string. Received undefined
Missing 'input' option or invalid path.
fixEnsure rollupStream({input: './src/main.js'}) with correct path. Error: You must specify input and output options.
rollup 0.x required both options; rollup-stream passes all to both rollup and generate.
fixRollup 0.x expects output options like dest, format. Pass them as top-level or use output key.
Audit
Dependencies
rolluprequiredPeer dependency – the actual bundler. Must be < 1.0.0 (e.g., 0.x). The package pins rollup@^0.67.0.