Mini-TSDown: Minimal TypeScript Bundler

0.1.9 · active · verified Wed Apr 22

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.

Common errors

Warnings

Install

Imports

Quickstart

Shows how to programmatically bundle a TypeScript project, generating ESM and CJS outputs with type declarations and sourcemaps.

import { build } from 'mini-tsdown';

async function bundleLibrary() {
  try {
    await build({
      entry: 'src/index.ts', // Adjust to your main entry point
      format: ['esm', 'cjs'],
      outDir: 'dist',
      dts: true,
      sourcemap: true,
      external: ['some-peer-dep'], // Example: mark a package as external
    });
    console.log('Build complete successfully!');
  } catch (error) {
    console.error('Build failed:', error);
    process.exit(1);
  }
}

bundleLibrary();

view raw JSON →