Registry / devops / dumble

dumble

JSON →
library0.2.2jsnpmunverified

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.

npm install dumble
INSTALL
IMPORT
SIG · DUMBLE
D
dumble
devopsjavascriptv0.2.2
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

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.

{ "name": "my-ts-app", "version": "1.0.0", "description": "A simple TypeScript project bundled with Dumble", "type": "module", "main": "./dist/index.cjs", "module": "./dist/index.mjs", "types": "./dist/index.d.ts", "scripts": { "build": "tsc -b && dumble" }, "devDependencies": { "dumble": "^0.2.2", "typescript": "^5.0.0", "esbuild": "^0.20.0" } } // tsconfig.json { "compilerOptions": { "rootDir": "src", "outDir": "dist", "declaration": true, "emitDeclarationOnly": true, "noEmit": false, /* Ensure tsc emits declaration files */ "target": "esnext", "module": "esnext", "moduleResolution": "bundler", "strict": true, "esModuleInterop": true, "skipLibCheck": true }, "include": ["src"] } // src/index.ts export function greet(name: string): string { return `Hello, ${name}! Welcome to Dumble-bundled app.`; } console.log(greet('World')); // To run: // 1. npm init -y // 2. copy package.json, tsconfig.json, src/index.ts // 3. npm install // 4. npm run build // 5. node dist/index.mjs
dumble --version
Debug
Known issues
breakingAs 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.
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.
affects: >=0.0.0
gotchaDumble 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.
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"`.
affects: >=0.0.0
gotchaDumble'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.
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.
affects: >=0.0.0
gotchaDumble 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.
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.
affects: >=0.0.0
Errors
Common errors & fixes
Error: Command 'dumble' not found
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.
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`.
Failed to bundle: No output files specified in package.json or tsconfig.json
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`).
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" }`).
TypeScript compilation failed: ... (various TypeScript errors)
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.
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.
Upgrade
Version history
0.2.2latest on npm
Audit
Dependencies
esbuildrequiredCore bundling engine for high-performance JavaScript/TypeScript compilation.
typescriptrequiredRequired for type checking and .d.ts file generation, which Dumble itself does not handle.
Agent activity
4 hits · last 30 days
node
4
Resources
dumble — npm install dumble · libregistry