tsdown
Skill3.1k starsChanged 9 months agoMITView on GitHub
Bundle TypeScript and JavaScript libraries with blazing-fast speed powered by Rolldown. Use when building libraries, generating type declarations, bundling for multiple formats, or migrating from tsup.
- Installs packages
17 other projects use a version of this, 13 of them edited.
Trending
Quiet since March.about the whole repository
Most recently taken up by
- Contentrain/studioedited, first seen Nov 8, 2026
- joker-ye/skillsedited, first seen Oct 13, 2026
- kirklin/skillsword for word, first seen Oct 13, 2026
- ragna-ai/ragna-studioedited, first seen Oct 11, 2026
- sanity-io/next-sanityedited, first seen Oct 8, 2026
- victorgarciaesgi/regleword for word, first seen Oct 8, 2026
Who's talking about TheEdoRan/next-safe-action
- vercel/next.js“"Server Actions must be async functions." being reported incorrectly”GitHub · Nov 5, 2024 · 13 reactions
- next-safe-action/next-safe-action“[BUG] `onError` called on redirects if it was called previously”GitHub · Dec 1, 2024 · 7 reactions
- next-safe-action/next-safe-action“[BUG] TypeScript issue with parsedInput in useAction Hook”GitHub · Jun 16, 2024 · 3 reactions
- next-safe-action/next-safe-action“[BUG] Not possible to handle errors that are not instance of Error”GitHub · Jan 10, 2025 · 2 reactions
- airjp73/rvf“Fix zod-form-data schema output type that are using `stripEmpty`”GitHub · Jun 10, 2025 · 1 reactions
The biggest 5 of 50 mentions linking to the repository that our crawl found. Each line is their own headline.
See all 50
Talked about on GitHub (50 times).
On GitHub · 50
- Nov 5, 2024"Server Actions must be async functions." being reported incorrectly — vercel/next.js13 reactions · 5 comments
- Dec 1, 2024[BUG] `onError` called on redirects if it was called previously — next-safe-action/next-safe-action7 reactions · 4 comments
- Jun 16, 2024[BUG] TypeScript issue with parsedInput in useAction Hook — next-safe-action/next-safe-action3 reactions · 8 comments
- Jan 10, 2025[BUG] Not possible to handle errors that are not instance of Error — next-safe-action/next-safe-action2 reactions · 3 comments
- Jun 10, 2025Fix zod-form-data schema output type that are using `stripEmpty` — airjp73/rvf1 reaction · 4 comments
45 more on GitHub
- May 20, 2025Zod v4 support — next-safe-action/next-safe-action1 reaction · 1 comment
- Feb 19, 2025Fix `zfd.formData` input type — airjp73/rvf1 reaction · 3 comments
- Mar 8, 2024[ASK] Error: Cannot access 'action' before initialization — next-safe-action/next-safe-action1 reaction · 3 comments
- Oct 11, 2023Dist files contain incorrect types — next-safe-action/next-safe-action1 reaction · 2 comments
- Mar 25, 2026Bump next-safe-action from 7.10.8 to 8.1.8 — ChazWyllie/kairofit0 reactions · 1 comment
- Mar 15, 2026chore(deps): bump the npm-dependencies group across 1 directory with 14 updates — startberlin/cockpit0 reactions · 2 comments
- Mar 4, 2026[BUG] `returnValidationErrors` called from middleware catch block throws instead of returning `validationErrors` — next-safe-action/next-safe-action0 reactions
- Mar 1, 2026build(deps): bump next-safe-action from 8.0.11 to 8.1.4 — wuyuan1992/react-components0 reactions · 2 comments
- Mar 1, 2026chore(deps): bump the npm-dependencies group across 1 directory with 12 updates — startberlin/cockpit0 reactions · 2 comments
- Feb 28, 2026Bump next-safe-action from 8.0.11 to 8.1.4 — rifandani/feature-flag0 reactions
- Feb 27, 2026Bump next-safe-action from 8.0.11 to 8.1.4 — joehentges/pendulem0 reactions
- Feb 11, 2026[Module Listing Request]: `nuxt-safe-action` — nuxt/modules0 reactions · 2 comments
- Dec 16, 2025Bump next-safe-action from 7.10.8 to 8.0.11 — hiteshhJ/ticketing-app0 reactions
- Oct 29, 2025Bump next-safe-action from 7.10.2 to 8.0.11 — akunpbhanz-lgtm/starter0 reactions · 1 comment
- Sep 30, 2025Bump next-safe-action from 7.10.8 to 8.0.11 — eersnington/diff00 reactions · 2 comments
- Sep 8, 2025Bump next-safe-action from 8.0.10 to 8.0.11 — joehentges/skyline0 reactions
- Sep 1, 2025[npm dependencies]: Bump next-safe-action from 7.10.8 to 8.0.11 in /src — Smegfi/papago0 reactions
- Sep 1, 2025chore(deps): bump next-safe-action from 8.0.8 to 8.0.11 — Shironex/portfolio0 reactions · 1 comment
- Sep 1, 2025chore: bump the dependencies group with 20 updates — alex289/NextJs-Boilerplate0 reactions · 2 comments
- Aug 25, 2025chore(deps): bump the all group across 1 directory with 94 updates — jaqubowsky/create-nextjs-app0 reactions · 1 comment
- Aug 23, 2025chore: bump the dependencies group with 19 updates — alex289/NextJs-Boilerplate0 reactions · 3 comments
- Aug 18, 2025[npm dependencies]: Bump next-safe-action from 7.10.8 to 8.0.10 in /src — Smegfi/papago0 reactions · 1 comment
- Aug 18, 2025chore(deps): bump the all group with 71 updates — jaqubowsky/create-nextjs-app0 reactions · 2 comments
- Aug 18, 2025chore(deps): bump next-safe-action from 8.0.8 to 8.0.10 — Shironex/portfolio0 reactions · 1 comment
- Aug 1, 2025chore(deps): bump next-safe-action from 8.0.2 to 8.0.8 — rifandani/ai-monorepo0 reactions · 1 comment
- Aug 1, 2025⬆️ Bump next-safe-action from 7.10.4 to 8.0.8 — quantified-uncertainty/squiggle0 reactions · 4 comments
- Jul 28, 2025[npm dependencies]: Bump next-safe-action from 7.10.8 to 8.0.8 in /src — Smegfi/papago0 reactions · 1 comment
- Jul 15, 2025chore(deps): bump next-safe-action from 7.10.4 to 8.0.8 — santosmarco/github-jtgc5e-20 reactions
- Jul 15, 2025Bump the dependencies group with 6 updates — RasengunShotaro/pdcxa0 reactions · 1 comment
- Jun 30, 2025[npm dependencies]: Bump next-safe-action from 7.10.8 to 8.0.7 in /src — Smegfi/papago0 reactions · 1 comment
- Jun 26, 2025Bump the dependencies group with 5 updates — RasengunShotaro/pdcxa0 reactions
- Jun 23, 2025[npm dependencies]: Bump next-safe-action from 7.10.8 to 8.0.4 in /src — Smegfi/papago0 reactions · 1 comment
- Jun 17, 2025chore(deps): bump next-safe-action from 7.10.4 to 8.0.3 — santosmarco/github-jtgc5e-20 reactions · 1 comment
- Jun 16, 2025Bump next-safe-action from 7.10.8 to 8.0.3 — joehentges/skyline0 reactions · 1 comment
- Jun 12, 2025[BUG] throwValidationErrors with overrideErrorMessage not working in v7.10.5 — next-safe-action/next-safe-action0 reactions · 1 comment
- Jun 9, 2025Bump next-safe-action from 7.10.8 to 8.0.2 — joehentges/skyline0 reactions · 1 comment
- Jun 9, 2025chore(deps): bump next-safe-action from 7.10.4 to 8.0.2 — santosmarco/github-jtgc5e-20 reactions · 1 comment
- Jun 9, 2025[npm dependencies]: Bump next-safe-action from 7.10.8 to 8.0.2 in /src — Smegfi/papago0 reactions · 1 comment
- Jun 4, 2025chore(deps): bump next-safe-action from 7.10.4 to 8.0.1 — santosmarco/github-jtgc5e-20 reactions · 1 comment
- Jun 3, 2025chore(deps): bump next-safe-action from 7.10.4 to 8.0.0 — santosmarco/github-jtgc5e-20 reactions · 1 comment
- Jun 3, 2025Bump the dependencies group with 5 updates — RasengunShotaro/pdcxa0 reactions · 1 comment
- Jun 2, 2025Bump next-safe-action from 7.10.8 to 8.0.0 — joehentges/skyline0 reactions · 1 comment
- May 13, 2025chore(deps): bump next-safe-action from 7.10.4 to 7.10.8 — santosmarco/github-jtgc5e-20 reactions · 1 comment
- May 1, 2025chore(deps): bump next-safe-action from 7.10.5 to 7.10.8 — rifandani/ai-monorepo0 reactions · 1 comment
- May 1, 2025⬆️ Bump next-safe-action from 7.10.4 to 7.10.8 — quantified-uncertainty/squiggle0 reactions · 3 comments
Other versions17 projects use a version of this.
Word for word · 4
- dinerojs/dinero.js★ 6.8k100% same
- victorgarciaesgi/regle★ 508100% same
- heamlk/Python-Skill★ 1100% same
- kirklin/skills★ 1100% same
Edited · 13
- moeru-ai/airi★ 51k66% same
- rolldown/tsdown★ 4.3k62% same
- crxjs/chrome-extension-tools★ 4.2k62% same
- sanity-io/next-sanity★ 95675% same
- JetBrains/skills★ 38674% same
- Contentrain/studio★ 475% same
- juwenzhang/lhx-kit★ 462% same
- huangzida/skills★ 275% same
- ElyzeSolutions/skills★ 166% same
- joker-ye/skills★ 190% same
3 more not listed
Wrote their own version · 0
None found.
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository12 other files it gives its agents.
- AGENTS.mdAGENTS.md
- .agents/skills/vercel-react-best-practices/AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- frontend-designSkill
- next-best-practicesSkill
- next-cache-componentsSkill
- next-upgradeSkill
- pnpmSkill
- skill-creatorSkill
- turborepoSkill
- vercel-react-best-practicesSkill
- vitestSkill
The file
We split this skill into the rules it gives an agent
2 rules. 2 are common, 0 are distinctive, and 0 are very specific to this project.
2
Common
Most of the 13 edited versions we read keep these.
0
Distinctive
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Common: line 239
Use functions for dynamic configuration:
- Common: line 255
Use glob patterns to build multiple packages:
“Common” is measured: kept by at least 6 in 10 of the 13 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
tsdown - The Elegant Library Bundler
Blazing-fast bundler for TypeScript/JavaScript libraries powered by Rolldown and Oxc.
When to Use
- Building TypeScript/JavaScript libraries for npm
- Generating TypeScript declaration files (.d.ts)
- Bundling for multiple formats (ESM, CJS, IIFE, UMD)
- Optimizing bundles with tree shaking and minification
- Migrating from tsup with minimal changes
- Building React, Vue, Solid, or Svelte component libraries
Quick Start
# Install
pnpm add -D tsdown
# Basic usage
npx tsdown
# With config file
npx tsdown --config tsdown.config.ts
# Watch mode
npx tsdown --watch
# Migrate from tsup
npx tsdown-migrateBasic Configuration
import { defineConfig } from 'tsdown'
export default defineConfig({
entry: ['./src/index.ts'],
format: ['esm', 'cjs'],
dts: true,
clean: true,
})Core References
| Topic | Description | Reference |
| Getting Started | Installation, first bundle, CLI basics | guide-getting-started |
| Configuration File | Config file formats, multiple configs, workspace | option-config-file |
| CLI Reference | All CLI commands and options | reference-cli |
| Migrate from tsup | Migration guide and compatibility notes | guide-migrate-from-tsup |
| Plugins | Rolldown, Rollup, Unplugin support | advanced-plugins |
| Hooks | Lifecycle hooks for custom logic | advanced-hooks |
| Programmatic API | Build from Node.js scripts | advanced-programmatic |
| Rolldown Options | Pass options directly to Rolldown | advanced-rolldown-options |
| CI Environment | CI detection, 'ci-only' / 'local-only' values | advanced-ci |
Build Options
| Option | Usage | Reference |
| Entry points | entry: ['src/*.ts', '!**/*.test.ts'] | option-entry |
| Output formats | format: ['esm', 'cjs', 'iife', 'umd'] | option-output-format |
| Output directory | outDir: 'dist', outExtensions | option-output-directory |
| Type declarations | dts: true, dts: { sourcemap, compilerOptions, vue } | option-dts |
| Target environment | target: 'es2020', target: 'esnext' | option-target |
| Platform | platform: 'node', platform: 'browser' | option-platform |
| Tree shaking | treeshake: true, custom options | option-tree-shaking |
| Minification | minify: true, minify: 'dce-only' | option-minification |
| Source maps | sourcemap: true, 'inline', 'hidden' | option-sourcemap |
| Watch mode | watch: true, watch options | option-watch-mode |
| Cleaning | clean: true, clean patterns | option-cleaning |
| Log level | logLevel: 'silent', failOnWarn: 'ci-only' | option-log-level |
Dependency Handling
| Feature | Usage | Reference |
| External deps | external: ['react', /^@myorg\//] | option-dependencies |
| Inline deps | noExternal: ['dep-to-bundle'] | option-dependencies |
| Auto external | Automatic peer/dependency externalization | option-dependencies |
Output Enhancement
| Feature | Usage | Reference |
| Shims | shims: true - Add ESM/CJS compatibility | option-shims |
| CJS default | cjsDefault: true (default) / false | option-cjs-default |
| Package exports | exports: true - Auto-generate exports field | option-package-exports |
| CSS handling | [experimental] Still in development | option-css |
| Unbundle mode | unbundle: true - Preserve directory structure | option-unbundle |
| Package validation | publint: true, attw: true - Validate package | option-lint |
Framework & Runtime Support
| Framework | Guide | Reference |
| React | JSX transform, Fast Refresh | recipe-react |
| Vue | SFC support, JSX | recipe-vue |
| WASM | WebAssembly modules via rolldown-plugin-wasm | recipe-wasm |
Common Patterns
Basic Library Bundle
export default defineConfig({
entry: ['src/index.ts'],
format: ['esm', 'cjs'],
dts: true,
clean: true,
})Multiple Entry Points
export default defineConfig({
entry: {
index: 'src/index.ts',
utils: 'src/utils.ts',
cli: 'src/cli.ts',
},
format: ['esm', 'cjs'],
dts: true,
})Browser Library (IIFE/UMD)
export default defineConfig({
entry: ['src/index.ts'],
format: ['iife'],
globalName: 'MyLib',
platform: 'browser',
minify: true,
})React Component Library
export default defineConfig({
entry: ['src/index.tsx'],
format: ['esm', 'cjs'],
dts: true,
external: ['react', 'react-dom'],
plugins: [
// React Fast Refresh support
],
})Preserve Directory Structure
export default defineConfig({
entry: ['src/**/*.ts', '!**/*.test.ts'],
unbundle: true, // Preserve file structure
format: ['esm'],
dts: true,
})CI-Aware Configuration
export default defineConfig({
entry: ['src/index.ts'],
format: ['esm', 'cjs'],
dts: true,
failOnWarn: 'ci-only',
publint: 'ci-only',
attw: 'ci-only',
})WASM Support
import { wasm } from 'rolldown-plugin-wasm'
import { defineConfig } from 'tsdown'
export default defineConfig({
entry: ['src/index.ts'],
plugins: [wasm()],
})Advanced with Hooks
export default defineConfig({
entry: ['src/index.ts'],
format: ['esm', 'cjs'],
dts: true,
hooks: {
'build:before': async (context) => {
console.log('Building...')
},
'build:done': async (context) => {
console.log('Build complete!')
},
},
})Configuration Features
Multiple Configs
Export an array for multiple build configurations:
export default defineConfig([
{
entry: ['src/index.ts'],
format: ['esm', 'cjs'],
dts: true,
},
{
entry: ['src/cli.ts'],
format: ['esm'],
platform: 'node',
},
])Conditional Config
Use functions for dynamic configuration:
export default defineConfig((options) => {
const isDev = options.watch
return {
entry: ['src/index.ts'],
format: ['esm', 'cjs'],
minify: !isDev,
sourcemap: isDev,
}
})Workspace/Monorepo
Use glob patterns to build multiple packages:
export default defineConfig({
workspace: 'packages/*',
entry: ['src/index.ts'],
format: ['esm', 'cjs'],
dts: true,
})CLI Quick Reference
# Basic commands
tsdown # Build once
tsdown --watch # Watch mode
tsdown --config custom.ts # Custom config
npx tsdown-migrate # Migrate from tsup
# Output options
tsdown --format esm,cjs # Multiple formats
tsdown --outDir lib # Custom output directory
tsdown --minify # Enable minification
tsdown --dts # Generate declarations
# Entry options
tsdown src/index.ts # Single entry
tsdown src/*.ts # Glob patterns
tsdown src/a.ts src/b.ts # Multiple entries
# Development
tsdown --watch # Watch mode
tsdown --sourcemap # Generate source maps
tsdown --clean # Clean output directoryBest Practices
- Always generate type declarations for TypeScript libraries:
{ dts: true } - Externalize dependencies to avoid bundling unnecessary code:
{ external: [/^react/, /^@myorg\//] } - Use tree shaking for optimal bundle size:
{ treeshake: true } - Enable minification for production builds:
{ minify: true } - Add shims for better ESM/CJS compatibility:
{ shims: true } // Adds __dirname, __filename, etc. - Auto-generate package.json exports:
{ exports: true } // Creates proper exports field - Use watch mode during development:
tsdown --watch - Preserve structure for utilities with many files:
{ unbundle: true } // Keep directory structure - Validate packages in CI before publishing:
{ publint: 'ci-only', attw: 'ci-only' }
Resources
- Documentation: https://tsdown.dev
- GitHub: https://github.com/rolldown/tsdown
- Rolldown: https://rolldown.rs
- Migration Guide: https://tsdown.dev/guide/migrate-from-tsup
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

