tsdown
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chinesetsdown
tsdown
Rolldown + Oxc powered TypeScript bundler. Drop-in tsup replacement.
基于Rolldown + Oxc的TypeScript打包工具。可直接替代tsup。
When to Use
适用场景
- Building TypeScript libraries
- Generating .d.ts declarations
- Publishing npm packages
- Dual ESM/CJS output
- Vue/React component libraries
- 构建TypeScript库
- 生成.d.ts声明文件
- 发布npm包
- 双ESM/CJS输出
- Vue/React组件库
Quick Start
快速开始
bash
npm i -D tsdown typescriptts
// tsdown.config.ts
import { defineConfig } from 'tsdown'
export default defineConfig({
entry: 'src/index.ts',
format: 'esm',
dts: true,
exports: true,
})bash
tsdown # Build
tsdown --watch # Watch modebash
npm i -D tsdown typescriptts
// tsdown.config.ts
import { defineConfig } from 'tsdown'
export default defineConfig({
entry: 'src/index.ts',
format: 'esm',
dts: true,
exports: true,
})bash
tsdown # 构建
tsdown --watch # 监听模式Reference Files
参考文档
| Task | File |
|---|---|
| Config file, CLI, entry points | config.md |
| Format, target, dts, exports, validation | output.md |
| Shims, unbundle, watch, frameworks, WASM | features.md |
| Plugins, hooks, lint, programmatic, migration | advanced.md |
| 任务 | 文件 |
|---|---|
| 配置文件、CLI、入口点 | config.md |
| 格式、目标环境、dts、导出、验证 | output.md |
| 垫片、不打包、监听、框架、WASM | features.md |
| 插件、钩子、代码检查、程序化调用、迁移 | advanced.md |
Loading Files
文件加载建议
Consider loading these reference files based on your task:
- references/config.md - if setting up tsdown.config.ts, CLI, or entry points
- references/output.md - if configuring output format, target, .d.ts, exports, or validation
- references/features.md - if using shims, unbundle, watch mode, framework integrations, or WebAssembly
- references/advanced.md - if writing plugins, using linting/validation, programmatic API, or migrating from tsup
DO NOT load all files at once. Load only what's relevant to your current task.
请根据你的任务加载对应的参考文件:
- references/config.md - 若你正在设置tsdown.config.ts、CLI或入口点
- references/output.md - 若你正在配置输出格式、目标环境、.d.ts、导出或验证
- references/features.md - 若你正在使用垫片、不打包模式、监听模式、框架集成或WebAssembly
- references/advanced.md - 若你正在编写插件、使用代码检查/验证、程序化API或从tsup迁移
请勿一次性加载所有文件。仅加载与当前任务相关的文件。
Cross-Skill References
跨技能参考
- Library patterns → Use skill
ts-library - Vue component libs → Use skill
vue - Package management → Use skill
pnpm
- 库模式 → 使用技能
ts-library - Vue组件库 → 使用技能
vue - 包管理 → 使用技能
pnpm