Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
oakoss avatar

Tsdown

  • 55 installs
  • 14 repo stars
  • Updated March 2, 2026
  • oakoss/agent-skills

Helps with ai & agent building tasks during AI-assisted development.

About

tsdown is a Claude Code skill for ai & agent building. It helps solo builders move faster with AI-assisted coding.

  • tsdown
  • AI & Agent Building
  • AI-coding skill

Tsdown by the numbers

  • 55 all-time installs (skills.sh)
  • +1 installs in the week ending Aug 4, 2026 (Skillselion tracking)
  • Ranked #6,793 of 16,546 AI & Agent Building skills by installs in the Skillselion catalog
  • Data as of Aug 4, 2026 (Skillselion catalog sync)
npx skills add https://github.com/oakoss/agent-skills --skill tsdown

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs55
repo stars14
Last updatedMarch 2, 2026
Repositoryoakoss/agent-skills

What it does

Helps with ai & agent building tasks during AI-assisted development.

Files

SKILL.mdMarkdownGitHub ↗

tsdown

Overview

tsdown is an elegant library bundler built on Rolldown (Rust-based), providing a complete out-of-the-box solution for building TypeScript and JavaScript libraries. It handles source transformation, multiple output formats (ESM, CJS, IIFE, UMD), TypeScript declaration file generation, and package.json exports field generation with sensible defaults.

When to use: Building TypeScript libraries for npm, generating declaration files, producing dual ESM/CJS packages, bundling CLI tools, library development with watch mode, migrating from tsup.

When NOT to use: Application bundling (use Vite/Rolldown directly), server-side rendering frameworks (use framework bundlers), projects that need Webpack-specific features, simple scripts that need no bundling.

Quick Reference

PatternAPIKey Points
Basic buildnpx tsdownAuto-detects src/index.ts entry
Config filetsdown.config.tsdefineConfig() for type safety
Entry pointsentry: ['src/index.ts']String, array, or object for named entries
Output formatsformat: ['esm', 'cjs']ESM, CJS, IIFE, UMD supported
Declaration filesdts: trueAuto-detects from package.json types field
Fixed extensionsfixedExtension: trueForces .mjs/.cjs and .d.mts/.d.cts
Externalsexternal: ['react']node_modules external by default
Bundle depsnoExternal: ['lodash-es']Force-bundle specific dependencies
Targettarget: 'node18'ES version or Node version
Platformplatform: 'node'node, browser, or neutral
Minificationminify: trueTree shaking enabled separately
Tree shakingtreeshake: trueDead code elimination
Source mapssourcemap: trueInline or external source maps
Watch modetsdown --watchAuto-rebuild on file changes
Clean outputclean: trueRemove output directory before build
Validation--publint --attwPackage quality checks post-build
Size report--reportBundle size with gzip/brotli stats
Multiple configsdefineConfig([...])Array of configs for different outputs
Dynamic configdefineConfig((opts) => {})Function receiving CLI options
Programmatic APIimport { build }Use in Node.js scripts
Banner/Footerbanner: { js: '...' }Prepend/append to output files
onSuccess hookonSuccess: async () => {}Run after successful build
Node protocolnodeProtocol: trueAdd/strip node: prefix on built-in imports

Common Mistakes

MistakeCorrect Pattern
Not setting fixedExtension with dual formatsUse fixedExtension: true for .mjs/.cjs when publishing both ESM and CJS
Bundling all node_modules into library outputDependencies are external by default; use noExternal only for specific deps
Using dts: true without TypeScript configuredEnsure tsconfig.json exists with proper compilerOptions
Setting target too low for modern syntaxMatch target to your minimum supported Node/browser version
Missing types field in package.jsonAdd types or exports types condition for declaration resolution
Not cleaning output before format changesUse clean: true to avoid stale files from previous builds
Inline external for Node built-insNode built-ins (node:fs, etc.) are auto-externalized on platform: 'node'
Using interactive CLI flags in CIUse config file or non-interactive CLI flags for CI builds

Delegation

  • Build configuration review: Use Task agent to analyze tsdown config for correctness
  • Package publishing: Use Explore agent to verify package.json exports and types fields
  • Migration from tsup: Use Task agent to map tsup options to tsdown equivalents

References

  • Configuration: config file, entry points, output formats, target, platform, externals
  • Declaration files: DTS generation, isolated declarations, type bundling
  • Advanced features: plugins, code splitting, tree shaking, watch mode, validation

Related skills

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.