Registry / devops / gulp-rollup

gulp-rollup

JSON →
library2.17.0jsnpmunverified

gulp-rollup is a Gulp plugin designed to integrate the Rollup ES6 module bundler into a Gulp workflow. Currently at version 2.17.0, its release cadence appears to be very slow, if not effectively halted, largely due to the maintainers' strong recommendation to use alternative solutions for most common use cases. The plugin's core differentiator is its ability to process files that have been synthesized or transformed *within* Gulp's virtual filesystem before being passed to Rollup. However, this approach necessitates that every file expected to be imported by Rollup is preemptively loaded into memory, making it inefficient and generally 'not appropriate for most use cases' due to potential performance and memory issues, especially with larger projects. Developers are strongly encouraged to consider `rollup-stream` for standard bundling needs or `rollup-plugin-gulp` for integrating Gulp transforms as Rollup plugins. This package primarily serves niche scenarios where extensive in-Gulp file synthesis is unavoidable before bundling.

npm install gulp-rollup
INSTALL
IMPORT
SIG · GULP-ROLLUP
G
gulp-rollup
devopsjavascriptv2.17.0
Install
—
Import
—
Disk
—
Pass rate
0/ 6
Env Coverage0 / 6
glibc
18–22
musl
18–22
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
musl
node 18–226 runs
build_error
glibc
node 18–226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

rollup
✓ const rollup = require('gulp-rollup');
✗ import rollup from 'gulp-rollup';
CommonJS require() syntax is used; this plugin typically integrates into Gulp setups which historically use CommonJS.
gulp
✓ const gulp = require('gulp');
✗ import gulp from 'gulp';
Standard CommonJS import for the Gulp task runner.
sourcemaps
✓ const sourcemaps = require('gulp-sourcemaps');
✗ import sourcemaps from 'gulp-sourcemaps';
CommonJS import for integrating source map functionality.

Demonstrates bundling ES6 modules with Rollup in a Gulp task, including source map generation and a basic Rollup configuration.

var gulp = require('gulp'), rollup = require('gulp-rollup'), sourcemaps = require('gulp-sourcemaps'); gulp.task('bundle', function() { return gulp.src('./src/**/*.js') .pipe(sourcemaps.init()) // Transform files here if needed, before Rollup processes them. .pipe(rollup({ // Any option supported by Rollup can be set here. // 'input' is mandatory, 'output' options are handled by gulp.dest() input: './src/main.js', // Example Rollup option: allow external modules external: ['lodash'] })) .pipe(sourcemaps.write('./maps')) // Writes sourcemaps to a 'maps' subdirectory in dest .pipe(gulp.dest('./dist')); });
Debug
Known issues
gotchaThis plugin is generally not recommended for most use cases. It requires all files to be loaded into memory preemptively, leading to potential performance and memory issues for larger projects.
fix
For most scenarios, use `rollup-stream` or `rollup-plugin-gulp` instead. Only use `gulp-rollup` if extensive in-Gulp file synthesis is absolutely necessary before bundling.
affects: >=1.0.0
gotchaUsing `options.allowRealFiles: true` breaks Gulp plugin guidelines by allowing Rollup to read files directly from the filesystem, bypassing the Gulp stream.
fix
Avoid `options.allowRealFiles`. Ensure all necessary files are included in the Gulp stream via `gulp.src()` or utilize Rollup plugins for complex file handling and transformations.
affects: >=1.0.0
gotchaHigh memory consumption can occur with projects containing a large number of files, as all files are loaded into memory before Rollup processing.
fix
If you must use `gulp-rollup`, consider breaking up your Gulp tasks into smaller, more manageable streams or processing files in batches to mitigate memory pressure. Prefer `rollup-stream` for better memory efficiency.
affects: >=1.0.0
Errors
Common errors & fixes
RollupError: Could not resolve 'module-name' from './path/to/file.js'
`gulp-rollup` expects all files, including their dependencies, to be present within the Gulp stream for Rollup to resolve them.
fix
Ensure all files referenced by Rollup, including external modules, are included in your `gulp.src()` glob patterns. Alternatively, if appropriate for your use case, configure Rollup's `external` option or use `options.allowRealFiles: true` with caution.
JavaScript heap out of memory / FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed
Too many files are being loaded into memory simultaneously by Gulp before being processed by Rollup, exceeding Node.js's heap limit.
fix
This is a direct consequence of the plugin's design. If possible, refactor your build process to use `rollup-stream` which handles files more efficiently. If `gulp-rollup` is essential, try to process fewer files at a time or increase Node.js's memory limit (e.g., `node --max-old-space-size=4096 gulp bundle`).
Upgrade
Version history
2.17.0latest on npm
Audit
Dependencies
gulprequiredRequired for Gulp task runner integration.
rolluprequiredThe underlying module bundler wrapped by this plugin.
gulp-sourcemapsoptionalCommonly used for source map generation within Gulp workflows.
Agent activity
12 hits · last 30 days
node
12
Resources
gulp-rollup — npm install gulp-rollup · libregistry