{"id":13094,"library":"dumble","title":"Dumble Bundler","description":"Dumble is a zero-configuration bundler specifically designed for TypeScript projects, leveraging the high-performance `esbuild` engine internally. It streamlines the build process by automatically inferring configuration from your project's `tsconfig.json` and `package.json` files, reducing the need for explicit bundler-specific configuration. Unlike some bundlers, Dumble is intended to be used in conjunction with the TypeScript compiler (`tsc`) for type checking and generating declaration files (`.d.ts`), while Dumble focuses on the actual JavaScript bundling and tree-shaking. Inspired by `pkgroll`, Dumble aims for a simpler, more focused approach to bundling, offering better integration into monorepos and allowing customization via `esbuild` CLI options. As of version 0.2.2, it's in active development, implying a likelihood of ongoing feature enhancements and potential breaking changes in minor versions.","status":"active","version":"0.2.2","language":"javascript","source_language":"en","source_url":"https://github.com/cordiverse/dumble","tags":["javascript","typescript"],"install":[{"cmd":"npm install dumble","lang":"bash","label":"npm"},{"cmd":"yarn add dumble","lang":"bash","label":"yarn"},{"cmd":"pnpm add dumble","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Core bundling engine for high-performance JavaScript/TypeScript compilation.","package":"esbuild","optional":false},{"reason":"Required for type checking and .d.ts file generation, which Dumble itself does not handle.","package":"typescript","optional":false}],"imports":[],"quickstart":{"code":"{\n  \"name\": \"my-ts-app\",\n  \"version\": \"1.0.0\",\n  \"description\": \"A simple TypeScript project bundled with Dumble\",\n  \"type\": \"module\",\n  \"main\": \"./dist/index.cjs\",\n  \"module\": \"./dist/index.mjs\",\n  \"types\": \"./dist/index.d.ts\",\n  \"scripts\": {\n    \"build\": \"tsc -b && dumble\"\n  },\n  \"devDependencies\": {\n    \"dumble\": \"^0.2.2\",\n    \"typescript\": \"^5.0.0\",\n    \"esbuild\": \"^0.20.0\"\n  }\n}\n// tsconfig.json\n{\n  \"compilerOptions\": {\n    \"rootDir\": \"src\",\n    \"outDir\": \"dist\",\n    \"declaration\": true,\n    \"emitDeclarationOnly\": true,\n    \"noEmit\": false, /* Ensure tsc emits declaration files */\n    \"target\": \"esnext\",\n    \"module\": \"esnext\",\n    \"moduleResolution\": \"bundler\",\n    \"strict\": true,\n    \"esModuleInterop\": true,\n    \"skipLibCheck\": true\n  },\n  \"include\": [\"src\"]\n}\n// src/index.ts\nexport function greet(name: string): string {\n  return `Hello, ${name}! Welcome to Dumble-bundled app.`;\n}\n\nconsole.log(greet('World'));\n\n// To run:\n// 1. npm init -y\n// 2. copy package.json, tsconfig.json, src/index.ts\n// 3. npm install\n// 4. npm run build\n// 5. node dist/index.mjs","lang":"typescript","description":"This quickstart demonstrates setting up a TypeScript project with Dumble, including `package.json` scripts, `tsconfig.json` configuration for type checking and declaration output, and a simple `src/index.ts` file. It shows how to integrate `tsc` for type generation and `dumble` for JavaScript bundling into a single build command."},"warnings":[{"fix":"Pin `dumble` to a specific minor version (e.g., `\"dumble\": \"~0.2.0\"`) and carefully review release notes before upgrading. Implement robust testing for build output.","message":"As Dumble is in early development (version 0.x.x), minor releases may introduce breaking API changes without a major version bump. Developers should consult the GitHub repository's changelog or releases for detailed updates.","severity":"breaking","affected_versions":">=0.0.0"},{"fix":"Always run `tsc -b` (or `tsc --emitDeclarationOnly true`) *before* or *alongside* `dumble` in your build script to ensure type checking and declaration file generation, e.g., `\"build\": \"tsc -b && dumble\"`.","message":"Dumble does not perform TypeScript type checking or generate `.d.ts` declaration files. It explicitly relies on `tsc` (the TypeScript compiler) for these tasks. Running `dumble` alone will only bundle JavaScript, potentially omitting critical type information or failing to catch type errors.","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Ensure `package.json` defines `main`, `module`, `types` fields and `exports` map appropriately for your desired output. Verify `tsconfig.json` includes `rootDir`, `outDir`, `target`, and `module` options consistent with your project structure and desired build artifacts.","message":"Dumble's 'zero-configuration' approach relies heavily on inferring settings from `tsconfig.json` and `package.json` (e.g., `main`, `module`, `exports`, `outDir`, `rootDir`, `target`). If these files are missing, misconfigured, or specify unconventional paths, Dumble might not produce the expected output, leading to silent failures or incorrect bundles.","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Carefully review your `package.json` dependency types. If a dependency listed in `devDependencies` needs to be externalized, or vice-versa, Dumble's documentation should be consulted for potential override options or alternative bundling strategies.","message":"Dumble treats `dependencies`, `peerDependencies`, and `optionalDependencies` in `package.json` as external by default, while `devDependencies` are bundled. This behavior might differ from other bundlers or user expectations, potentially leading to larger-than-expected bundles or runtime errors if dependencies are not correctly externalized or bundled.","severity":"gotcha","affected_versions":">=0.0.0"}],"env_vars":null,"last_verified":"2026-04-19T00:00:00.000Z","next_check":"2026-07-18T00:00:00.000Z","problems":[{"fix":"Ensure `dumble` is installed as a development dependency (`npm install --save-dev dumble` or `yarn add -D dumble`) and run it via an npm script (e.g., `npm run build`) or `npx dumble`.","cause":"The `dumble` package is not installed or not available in the system's PATH, typically when run directly from the terminal without `npx` or a `package.json` script.","error":"Error: Command 'dumble' not found"},{"fix":"Add explicit output configurations to your `package.json` (e.g., `\"main\": \"./dist/index.cjs\", \"module\": \"./dist/index.mjs\", \"types\": \"./dist/index.d.ts\"`) and `tsconfig.json` (`\"compilerOptions\": { \"outDir\": \"./dist\" }`).","cause":"Dumble could not determine the desired output paths or formats because `package.json` and `tsconfig.json` lack the necessary fields (e.g., `main`, `module`, `types`, `outDir`).","error":"Failed to bundle: No output files specified in package.json or tsconfig.json"},{"fix":"Address the specific TypeScript errors reported by `tsc`. Ensure your `tsconfig.json` is correctly configured and all type dependencies are installed. You can run `tsc -b` or `tsc --noEmit` directly to debug type issues independently of Dumble.","cause":"Dumble relies on the `tsc` command for type checking. This error indicates that `tsc` encountered type errors in your source code or configuration, which prevents successful type declaration file generation.","error":"TypeScript compilation failed: ... (various TypeScript errors)"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":"dumble"}