mini-tsdown is a minimal TypeScript library bundler, currently at version 0.1.9, designed primarily for learning purposes and providing a performant build experience. It leverages the Rust-based bundler Rolldown and the Rust-based parser/linter Oxc, offering fast bundling for TypeScript projects. The tool supports multi-format output (ESM and CJS), automatically generates TypeScript declaration files (.d.ts), includes a watch mode for development, and features a flexible hook system for customizing the build lifecycle. Configuration can be managed via dedicated config files (TS, JS, JSON) or CLI options. While its release cadence is not formally defined due to its early stage and "learning purposes" designation, it provides a lightweight, performant alternative focused on TypeScript library bundling, differentiating itself from larger, more general-purpose bundlers by its minimal approach and Rust-powered core.
npm install mini-tsdownVerified import paths — ran on the pinned version, not inferred.
Shows how to programmatically bundle a TypeScript project, generating ESM and CJS outputs with type declarations and sourcemaps.
Review the latest README and changelog (if available) for each update. Pin exact versions in `package.json` to avoid unexpected breakage in production environments.
Ensure `typescript@^5.0.0` or `typescript@^6.0.0` is installed as a `devDependency` in your project: `pnpm add -D typescript` or `npm install --save-dev typescript`.
Understand the option precedence: CLI flags override configuration file settings. Use the config file for default build settings and CLI for temporary overrides or specific, one-off build commands.
Install TypeScript as a development dependency: `pnpm add -D typescript` or `npm install --save-dev typescript`.
Verify the `entry` path in your `mini-tsdown.config.ts` or the CLI command `npx mini-tsdown <entry-file>` points to an existing file in your project structure.
Ensure your `mini-tsdown.config.ts` uses ESM `import { defineConfig } from 'mini-tsdown'` and that your environment (tsconfig `module` and `moduleResolution` settings) is configured for TypeScript with ESM.