Registry / devops / mini-tsdown

mini-tsdown

JSON →
library0.1.9jsnpmunverified

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-tsdown
INSTALL
IMPORT
SIG · MINI-TSDOWN
M
mini-tsdown
devopsjavascriptv0.1.9
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

defineConfig
import { defineConfig } from 'mini-tsdown'
const defineConfig = require('mini-tsdown').defineConfig
Primarily used in `mini-tsdown.config.ts` for type-safe configuration. Always use ESM `import`.
build
import { build } from 'mini-tsdown'
const build = require('mini-tsdown').build
The core programmatic API function. Returns a Promise.
BuildOptions
import type { BuildOptions } from 'mini-tsdown'
Used for type annotations when defining build configurations programmatically or for inline options.

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();
mini-tsdown --version
Debug
Known issues
breakingAs `mini-tsdown` is an early-stage project (v0.1.9) created 'for learning purposes', its API is subject to frequent and potentially breaking changes without strict adherence to semantic versioning. Configuration options, CLI flags, and programmatic interfaces may change significantly between minor versions.
fix
Review the latest README and changelog (if available) for each update. Pin exact versions in `package.json` to avoid unexpected breakage in production environments.
affects: >=0.1.0
gotcha`mini-tsdown` requires a peer dependency on `typescript` (v5.0.0 or v6.0.0). Failing to install a compatible version will prevent type declaration generation and potentially other TypeScript-related features from working correctly, leading to build failures.
fix
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`.
affects: >=0.1.0
gotchaCLI options take precedence over options defined in `mini-tsdown.config.ts`. If both are provided for the same setting (e.g., `--format esm` via CLI and `format: ['cjs']` in config), the CLI value will always override the configuration file setting.
fix
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.
affects: >=0.1.0
Errors
Common errors & fixes
Error: Cannot find module 'typescript'
The `typescript` peer dependency is missing from your project's `devDependencies`.
fix
Install TypeScript as a development dependency: `pnpm add -D typescript` or `npm install --save-dev typescript`.
Error: Entry point 'src/index.ts' not found.
The specified entry file either does not exist or the path provided is incorrect.
fix
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.
TypeError: defineConfig is not a function
Attempting to use `defineConfig` with CommonJS `require()` syntax in a TypeScript configuration file, which expects ESM `import`.
fix
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.
Upgrade
Version history
0.1.9latest on npm
Audit
Dependencies
typescriptrequiredRequired for TypeScript compilation and type declaration generation.
Agent activity
2 hits · last 30 days
node
2
Resources
mini-tsdown — npm install mini-tsdown · libregistry