Registry / devops / gulp-dumber

gulp-dumber

JSON →
library3.0.0jsnpmunverified

gulp-dumber is a Gulp plugin that integrates the dumber JavaScript bundler into Gulp build pipelines. Released as version 3.0.0 in September 2024, it currently targets Node.js 18 and above. The dumber bundler differentiates itself from all-in-one solutions by strictly adhering to the Unix philosophy: it focuses solely on tracing dependencies and packing modules, intentionally omitting features like transpiling, minification, or serving. These responsibilities are left to other Gulp plugins (e.g., gulp-babel, gulp-typescript, gulp-terser), providing users with granular control and flexibility over their build process. It utilizes dumber-module-loader, an AMD loader, for runtime module resolution, supporting npm packages and flexible code splitting. A key design choice is the absence of a fixed entry module, and it manages local source dependencies passively, warning about unfulfilled dependencies but still bundling, allowing for runtime loading of missing modules. It does not support multiple versions of the same npm package within a single bundle. gulp-dumber is often used as part of project scaffolds generated by npx makes dumberjs for modern SPA frameworks like Aurelia, React, or Vue.

npm install gulp-dumber
INSTALL
IMPORT
SIG · GULP-DUMBER
G
gulp-dumber
devopsjavascriptv3.0.0
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
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 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

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

dumber
const dumber = require('gulp-dumber');
import dumber from 'gulp-dumber';
CommonJS `require` is the traditional and still widely used method for importing Gulp plugins within `gulpfile.js`.
dumber
import dumber from 'gulp-dumber';
const dumber = require('gulp-dumber');
ESM `import` syntax is supported for Node.js >=18 environments when the project or Gulpfile is configured for ESM (e.g., 'type': 'module' in package.json or using .mjs extension).
dr() (plugin instance)
stream.pipe(dr())
stream.pipe(dumber())
The imported `dumber` is a factory function. It must be called (`dumber({...})`) to return a Gulp plugin stream instance (commonly named `dr`) which is then piped.

Demonstrates a typical Gulp build pipeline using gulp-dumber. This example includes pre-transpilation with Babel and combines multiple asset streams, highlighting dumber's specific role as a bundler focusing on trace and pack, not pre-processing.

const gulp = require('gulp'); const dumber = require('gulp-dumber'); const babel = require('gulp-babel'); // Example pre-processor, install separately const merge2 = require('merge2'); // To combine multiple streams, install separately // 1. Configure the dumber instance with options const dr = dumber({ // Optional: customize the main bundle name (default 'entry-bundle.js') // entryBundle: 'main-app', // Optional: enable cache busting by adding content hashes to filenames // hash: true, // Optional: callback to consume the manifest generated by dumber // onManifest: (manifest) => { console.log(manifest); } }); // 2. Define a task to transpile JavaScript files // dumber itself does not transpile; pre-processing like Babel must happen before. function transpileJs() { return gulp.src('src/**/*.js') .pipe(babel({ presets: ['@babel/preset-env'] })); // Requires @babel/core & @babel/preset-env } // 3. Define a task to process other static assets (HTML, JSON, CSS, etc.) // dumber can directly handle these file types after any necessary pre-processing. function processOtherAssets() { return gulp.src(['src/**/*.html', 'src/**/*.json', 'src/**/*.css']); } // 4. Define the main bundling task function bundleApp() { // Combine all pre-processed and raw asset streams into a single stream // using merge2, then pipe them to the gulp-dumber plugin instance. // dumber will then trace dependencies, pack modules, and output bundles. return merge2( transpileJs(), processOtherAssets() ) .pipe(dr()) // The gulp-dumber plugin acts as a transform stream here .pipe(gulp.dest('dist')); // Write the resulting bundles to the 'dist' folder } // Export tasks for the Gulp CLI exports.build = bundleApp; exports.default = bundleApp; // To run this example: // 1. Install dependencies: `npm install --save-dev gulp gulp-dumber gulp-babel @babel/core @babel/preset-env merge2` // 2. Create example files in a 'src' directory: e.g., src/index.html, src/app.js (with an ES module import), src/style.css // 3. Run the build: `gulp build`
gulp --version
Debug
Known issues
breakinggulp-dumber v3 requires dumber v3. Ensure compatibility with the underlying `dumber` library, as breaking changes in `dumber` itself may affect `gulp-dumber`'s usage and configuration.
fix
Review the dumber v3 changelog for any API changes and update your dumber configuration and options accordingly. Ensure the `dumber` package is explicitly updated to v3 or higher in your project dependencies.
affects: >=3.0.0
breakingGulp 4 introduced significant changes to task composition, replacing arrays of task names with `gulp.series()` and `gulp.parallel()`. Users migrating from Gulp 3 must update their task definitions.
fix
Refactor Gulp tasks to use `gulp.series()` and `gulp.parallel()` for composing tasks instead of passing arrays of task names. Consult the official Gulp 4 migration guides for detailed instructions.
affects: >=3.0.0 (in context of Gulp 4)
gotchaThe `dumber` bundler (and therefore `gulp-dumber`) explicitly does NOT perform transpilation (e.g., TypeScript, Babel, Sass, Less) or minification. These steps must be handled by separate Gulp plugins *before* piping files to `gulp-dumber`.
fix
Integrate appropriate pre-processor plugins (e.g., `gulp-babel`, `gulp-typescript`, `gulp-sass`, `gulp-less`) and minification plugins (e.g., `gulp-terser`, `gulp-clean-css`) into your Gulp pipeline *before* the `dr()` stream to pre-process assets.
affects: >=1.0.0
gotchadumber is 'passive' on local module dependencies. It will warn if a local dependency is not found in the Gulp stream but will still bundle, relying on the `dumber-module-loader` to potentially load missing modules at runtime.
fix
Ensure all local source files and their explicit or implicit dependencies are correctly included in the Gulp `src` streams that feed into `gulp-dumber` to prevent unexpected runtime loading of local files from remote sources.
affects: >=1.0.0
gotchadumber does not support bundling multiple versions of the same npm package. If version conflicts exist in your dependency tree, it bundles the top-level installed version, which might lead to unexpected behavior if specific versions are required by different parts of the application.
fix
Standardize npm package versions across your project dependencies. Tools like `npm dedupe` or `yarn install --flat` can help resolve conflicts. Carefully manage your `package.json` to avoid conflicting dependencies where specific versions are critical.
affects: >=1.0.0
Errors
Common errors & fixes
AssertionError [ERR_ASSERTION]: Task function must be specified
Attempting to define a Gulp task using Gulp 3 syntax (e.g., `gulp.task('name', ['dependency-task'], func)`) in a Gulp 4 environment.
fix
Update your Gulp task definitions to Gulp 4 syntax by using `gulp.series()` or `gulp.parallel()` for task composition: for example, `gulp.task('name', gulp.series('dependency-task', func));`.
TypeError: Cannot read properties of undefined (reading 'pipe') or similar stream errors when piping pre-processed files
This typically indicates that a required pre-processor plugin (e.g., `gulp-babel`, `gulp-typescript`) is either not installed, not correctly configured, or the stream it generates is empty or malformed before being piped to `gulp-dumber`.
fix
Verify all pre-processor plugins are installed (`npm install --save-dev [plugin-name]`), correctly configured (e.g., `.babelrc`, `tsconfig.json`), and that their Gulp streams are correctly chained and produce Vinyl files as expected before being fed into `gulp-dumber`.
Upgrade
Version history
3.0.0latest on npm
Audit
Dependencies
gulprequiredPeer dependency as it's a Gulp plugin, required for defining and running build tasks.
dumberrequiredThe core bundler library that this plugin integrates; gulp-dumber v3 requires dumber v3 for compatibility and functionality.
Agent activity
4 hits · last 30 days
node
4
Resources
gulp-dumber — npm install gulp-dumber · libregistry