{"id":13093,"library":"dumber","title":"Dumber JavaScript Bundler","description":"Dumber is a JavaScript bundler specifically designed for Single Page Applications (SPAs), prioritizing simplicity and ease of use. Currently at version 3.1.3, it is actively maintained with a focus on integrating seamlessly into existing build workflows, primarily through its companion Gulp plugin, `gulp-dumber`. Dumber's release cadence follows a semantic versioning approach, with minor and patch releases addressing new features, bug fixes, and performance improvements, while major versions may introduce breaking changes to its core API or configuration. It differentiates itself by being primarily consumed as a build tool integration rather than a standalone CLI or direct programmatic API, providing a streamlined experience for Gulp users. The project encourages using a generator (`npx makes dumberjs`) to scaffold new projects with Dumber pre-configured, highlighting its integration-first philosophy for modern web development.","status":"active","version":"3.1.3","language":"javascript","source_language":"en","source_url":"https://github.com/dumberjs/dumber","tags":["javascript","bundle","browser","spa","amd"],"install":[{"cmd":"npm install dumber","lang":"bash","label":"npm"},{"cmd":"yarn add dumber","lang":"bash","label":"yarn"},{"cmd":"pnpm add dumber","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"This is the primary method of interacting with Dumber. `gulp-dumber` exports a default function that acts as a Gulp plugin factory, taking Dumber's configuration.","wrong":"import { dumber } from 'dumber';","symbol":"dumber (Gulp plugin)","correct":"import dumber from 'gulp-dumber';"},{"note":"CommonJS import for the `gulp-dumber` plugin, which is the recommended way to use Dumber in a `gulpfile.js`.","wrong":"const { dumber } = require('dumber');","symbol":"dumber (Gulp plugin, CommonJS)","correct":"const dumber = require('gulp-dumber');"},{"note":"While discouraged for direct use by end-users, the core `dumber` package exports a named `dumber` function that serves as its programmatic API. This is primarily consumed by wrapper plugins like `gulp-dumber` for advanced or custom bundling scenarios. It expects a configuration object and returns a bundler instance.","wrong":"import dumber from 'dumber';","symbol":"dumber (core programmatic API)","correct":"import { dumber } from 'dumber';"}],"quickstart":{"code":"const gulp = require('gulp');\nconst dumber = require('gulp-dumber');\nconst plumber = require('gulp-plumber');\nconst path = require('path');\n\n// Initialize dumber with configuration\nconst dr = dumber({\n  // Base folder for source files. All relative paths will be resolved from here.\n  cwd: path.resolve(__dirname, 'src'),\n  // Defines entry points and resulting bundles\n  entryBundle: {\n    'app.js': ['main.js'], // Main application entry point\n    'vendor.js': ['../node_modules/lodash/lodash.js', '../node_modules/moment/moment.js'] // Example vendor bundle\n  },\n  // Output directory for bundled files\n  output: path.resolve(__dirname, 'dist'),\n  // Optional: sourcemap generation\n  sourcemap: 'inline',\n  // Optional: enables HMR/live-reload during development\n  onCache: function(filename) { console.log(`Cached: ${filename}`); }\n});\n\nfunction build() {\n  return gulp.src('src/**/*.js') // You can include other file types like .html, .css here\n    .pipe(plumber()) // Basic error handling plugin\n    .pipe(dr()) // Call the dumber Gulp plugin to process files\n    .pipe(gulp.dest('dist')); // Output bundled files\n}\n\n// Define build task for Gulp\nexports.default = build;\nexports.build = build;\n","lang":"javascript","description":"This quickstart demonstrates how to set up a `gulpfile.js` to build a JavaScript SPA using `gulp-dumber`. It configures dumber to create application and vendor bundles, includes basic error handling, and outputs to a specified directory."},"warnings":[{"fix":"Instead of attempting to import or configure `dumber` directly, install and use `gulp-dumber` within your Gulp build pipeline. Refer to the `gulp-dumber` documentation for correct usage patterns.","message":"The `dumber` npm package is a low-level core library and is not intended for direct use by application developers. Its primary interface is through `gulp-dumber` or similar build tool integrations.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Always consult the release notes and migration guides for both `dumber` and `gulp-dumber` when upgrading major versions. Carefully review your `gulpfile.js` for deprecated options or required structural changes.","message":"Major version upgrades (e.g., from v2 to v3) for `dumber` may introduce breaking changes in configuration options or the underlying bundling engine. These changes often propagate to `gulp-dumber`.","severity":"breaking","affected_versions":">=3.0.0"},{"fix":"Ensure your application code adheres to standard ES Modules or CommonJS patterns. For legacy scripts, consider using Dumber's configuration options for globals or external libraries, as demonstrated in `gulp-dumber` examples.","message":"Dumber's bundling relies on CommonJS or ESM module syntax. Using global scripts or non-standard module patterns might require manual configuration or lead to bundling issues.","severity":"gotcha","affected_versions":">=1.0.0"}],"env_vars":null,"last_verified":"2026-04-19T00:00:00.000Z","next_check":"2026-07-18T00:00:00.000Z","problems":[{"fix":"Ensure you are importing `gulp-dumber` (e.g., `const dumber = require('gulp-dumber');`) in your `gulpfile.js` and using its default export as the plugin.","cause":"This typically occurs when attempting to `require('dumber')` or `import { dumber } from 'dumber'` and then calling the result as a Gulp plugin directly, which is incorrect. The `dumber` core package doesn't expose a direct Gulp plugin.","error":"TypeError: dumber is not a function"},{"fix":"Verify that both `dumber` and `gulp-dumber` are listed in your `package.json` dependencies and installed (`npm install`). Check your import/require paths to ensure they match the package names exactly.","cause":"The `dumber` package or `gulp-dumber` is not installed, or the Node.js module resolution path is incorrect.","error":"Error: Cannot find module 'dumber'"},{"fix":"Double-check your `dumber` configuration within `gulp-dumber`. Ensure `cwd` is correctly pointing to your source root, `entryBundle` specifies valid entry points relative to `cwd`, and your `gulp.src()` pattern matches your source files.","cause":"Incorrect `entryBundle` configuration, missing `cwd` setting, or source files not being picked up by `gulp.src()` correctly.","error":"Bundle output is empty or missing expected files."}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":""}