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 dumbleNo compatibility data collected yet for this library.
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.
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.
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"`.
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.
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.
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`.
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" }`).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.