Official agent skill

Tsdown

by JetBrains in JetBrains/skills

Bundle TypeScript and JavaScript libraries with blazing-fast speed powered by Rolldown.

OfficialMITAuto-check passedFrontend & Design

Install Tsdown

skills CLI
$ npx skills add JetBrains/skills --skill tsdown -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install JetBrains/skills tsdown --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/JetBrains/skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/tsdown .claude/skills/tsdown && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
tsdown
GitHub stars
363
Used in
6 other repos
Token cost
~3k tokens
SKILL.md length
528 words
Files
42 (incl. references)
Skills in repo
79
Repo updated
First seen
Licence
MIT

At a glance

Bundle TypeScript and JavaScript libraries with blazing-fast speed powered by Rolldown.

  • Works in 9 steps: Always generate type declarations for… → Externalize dependencies to avoid… → Use tree shaking for optimal bundle size → …
  • Building libraries
  • SKILL.md covers When to Use, Quick Start, Basic Configuration and Core References, plus 9 more sections
  • Calls npx and pnpm

What it does

Tsdown is an agent skill from JetBrains/skills, published by the product's own GitHub organization. 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.

Its SKILL.md is about 3k tokens, which your agent loads only when the skill is triggered. The skill folder holds 42 other files, including reference files (for example `LICENSE.md`, `README.md` and `SYNC.md`).

It sits in Frontend & Design. It works with TypeScript and JavaScript. The repository describes itself as: Curated agent skills collection verified by JetBrains. The licence is MIT.

When your agent uses it

  • Building libraries
  • Generating type declarations
  • Bundling for multiple formats
  • Migrating from tsup

Example prompts

  • “/tsdown”

Requirements

  • Node.js

Workflow steps

9 steps, taken from the first numbered list in SKILL.md.

  1. Always generate type declarations for TypeScript libraries
  2. Externalize dependencies to avoid bundling unnecessary code
  3. Use tree shaking for optimal bundle size
  4. Enable minification for production builds
  5. Add shims for better ESM/CJS compatibility
  6. Auto-generate package.json exports
  7. Use watch mode during development
  8. Preserve structure for utilities with many files
  9. Validate packages in CI before publishing

What it can do on your machine

Read from SKILL.md and the folder at commit e0f258b. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • npx
    • pnpm

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Links to these hosts (documentation or services it may open):

    • tsdown.dev
    • github.com
    • rolldown.rs

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Tsdown loads about 3k tokens when it runs, and up to ~43k if it reads all its reference files. Until then it costs about 52 tokens; SKILL.md has 528 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~52
When it runs · the whole SKILL.md, loaded when a task matches
~3k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~43k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from JetBrains/skills at commit e0f258b, republished under its MIT licence (© JetBrains). 528 words, ~3,005 tokens.

Download SKILL.mdSave it as .claude/skills/tsdown/SKILL.md (or your agent's skills folder). This skill also uses 41 other files; get the full folder from GitHub.
name
tsdown
description
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.
metadata.short-description
Bundle TS/JS libraries with tsdown
metadata.author
Anthony Fu
metadata.source
https://github.com/antfu/skills/tree/main/skills/tsdown

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

bash
# 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-migrate

Basic Configuration

ts
import { defineConfig } from 'tsdown'

export default defineConfig({
  entry: ['./src/index.ts'],
  format: ['esm', 'cjs'],
  dts: true,
  clean: true,
})

Core References

TopicDescriptionReference
Getting StartedInstallation, first bundle, CLI basicsguide-getting-started
Configuration FileConfig file formats, multiple configs, workspaceoption-config-file
CLI ReferenceAll CLI commands and optionsreference-cli
Migrate from tsupMigration guide and compatibility notesguide-migrate-from-tsup
PluginsRolldown, Rollup, Unplugin supportadvanced-plugins
HooksLifecycle hooks for custom logicadvanced-hooks
Programmatic APIBuild from Node.js scriptsadvanced-programmatic
Rolldown OptionsPass options directly to Rolldownadvanced-rolldown-options
CI EnvironmentCI detection, 'ci-only' / 'local-only' valuesadvanced-ci

Build Options

OptionUsageReference
Entry pointsentry: ['src/*.ts', '!**/*.test.ts']option-entry
Output formatsformat: ['esm', 'cjs', 'iife', 'umd']option-output-format
Output directoryoutDir: 'dist', outExtensionsoption-output-directory
Type declarationsdts: true, dts: { sourcemap, compilerOptions, vue }option-dts
Target environmenttarget: 'es2020', target: 'esnext'option-target
Platformplatform: 'node', platform: 'browser'option-platform
Tree shakingtreeshake: true, custom optionsoption-tree-shaking
Minificationminify: true, minify: 'dce-only'option-minification
Source mapssourcemap: true, 'inline', 'hidden'option-sourcemap
Watch modewatch: true, watch optionsoption-watch-mode
Cleaningclean: true, clean patternsoption-cleaning
Log levellogLevel: 'silent', failOnWarn: falseoption-log-level

Dependency Handling

FeatureUsageReference
Never bundledeps: { neverBundle: ['react', /^@myorg\//] }option-dependencies
Always bundledeps: { alwaysBundle: ['dep-to-bundle'] }option-dependencies
Only bundledeps: { onlyBundle: ['cac', 'bumpp'] } - Whitelistoption-dependencies
Skip node_modulesdeps: { skipNodeModulesBundle: true }option-dependencies
Auto externalAutomatic peer/dependency externalizationoption-dependencies

Output Enhancement

FeatureUsageReference
Shimsshims: true - Add ESM/CJS compatibilityoption-shims
CJS defaultcjsDefault: true (default) / falseoption-cjs-default
Package exportsexports: true - Auto-generate exports fieldoption-package-exports
CSS handling[experimental] css: { ... } — full pipeline with preprocessors, Lightning CSS, PostCSS, code splitting; requires @tsdown/cssoption-css
CSS injectcss: { inject: true } — preserve CSS imports in JS outputoption-css
Unbundle modeunbundle: true - Preserve directory structureoption-unbundle
Root directoryroot: 'src' - Control output directory mappingoption-root
Executable[experimental] exe: true - Bundle as standalone executable, cross-platform via @tsdown/exeoption-exe
Package validationpublint: true, attw: true - Validate packageoption-lint
Show full SKILL.md (216 more words)Show less

Framework & Runtime Support

FrameworkGuideReference
ReactJSX transform, React Compilerrecipe-react
VueSFC support, JSXrecipe-vue
SolidSolidJS JSX transformrecipe-solid
SvelteSvelte component libraries (source distribution recommended)recipe-svelte
WASMWebAssembly modules via rolldown-plugin-wasmrecipe-wasm

Common Patterns

Basic Library Bundle
ts
export default defineConfig({
  entry: ['src/index.ts'],
  format: ['esm', 'cjs'],
  dts: true,
  clean: true,
})
Multiple Entry Points
ts
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)
ts
export default defineConfig({
  entry: ['src/index.ts'],
  format: ['iife'],
  globalName: 'MyLib',
  platform: 'browser',
  minify: true,
})
React Component Library
ts
export default defineConfig({
  entry: ['src/index.tsx'],
  format: ['esm', 'cjs'],
  dts: true,
  deps: {
    neverBundle: ['react', 'react-dom'],
  },
  inputOptions: {
    jsx: { runtime: 'automatic' },
  },
})
Preserve Directory Structure
ts
export default defineConfig({
  entry: ['src/**/*.ts', '!**/*.test.ts'],
  unbundle: true, // Preserve file structure
  format: ['esm'],
  dts: true,
})
CI-Aware Configuration
ts
export default defineConfig({
  entry: ['src/index.ts'],
  format: ['esm', 'cjs'],
  dts: true,
  failOnWarn: 'ci-only',  // opt-in: fail on warnings in CI
  publint: 'ci-only',
  attw: 'ci-only',
})
WASM Support
ts
import { wasm } from 'rolldown-plugin-wasm'
import { defineConfig } from 'tsdown'

export default defineConfig({
  entry: ['src/index.ts'],
  plugins: [wasm()],
})
Library with CSS and Sass
ts
export default defineConfig({
  entry: ['src/index.ts'],
  format: ['esm', 'cjs'],
  dts: true,
  target: 'chrome100',
  css: {
    preprocessorOptions: {
      scss: {
        additionalData: `@use "src/styles/variables" as *;`,
      },
    },
  },
})
Standalone Executable
ts
export default defineConfig({
  entry: ['src/cli.ts'],
  exe: true,
})
Cross-Platform Executable (requires @tsdown/exe)
ts
export default defineConfig({
  entry: ['src/cli.ts'],
  exe: {
    targets: [
      { platform: 'linux', arch: 'x64', nodeVersion: '25.7.0' },
      { platform: 'darwin', arch: 'arm64', nodeVersion: '25.7.0' },
      { platform: 'win', arch: 'x64', nodeVersion: '25.7.0' },
    ],
  },
})
Advanced with Hooks
ts
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:

ts
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:

ts
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:

ts
export default defineConfig({
  workspace: 'packages/*',
  entry: ['src/index.ts'],
  format: ['esm', 'cjs'],
  dts: true,
})

CLI Quick Reference

bash
# 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 -d lib                  # Custom output directory (--out-dir)
tsdown --minify                # Enable minification
tsdown --dts                   # Generate declarations
tsdown --exe                   # Bundle as standalone executable
tsdown --unbundle              # Bundleless mode

# Entry options
tsdown src/index.ts            # Single entry
tsdown src/*.ts                # Glob patterns
tsdown src/a.ts src/b.ts       # Multiple entries

# Workspace / Monorepo
tsdown -W                      # Enable workspace mode
tsdown -W -F my-package        # Filter specific package
tsdown --filter /^pkg-/        # Filter by regex

# Development
tsdown --watch                 # Watch mode
tsdown --sourcemap             # Generate source maps
tsdown --clean                 # Clean output directory
tsdown --from-vite             # Reuse Vite config
tsdown --tsconfig tsconfig.build.json  # Custom tsconfig

Best Practices

  1. Always generate type declarations for TypeScript libraries:

    ts
    { dts: true }
  2. Externalize dependencies to avoid bundling unnecessary code:

    ts
    { deps: { neverBundle: [/^react/, /^@myorg\//] } }
  3. Use tree shaking for optimal bundle size:

    ts
    { treeshake: true }
  4. Enable minification for production builds:

    ts
    { minify: true }
  5. Add shims for better ESM/CJS compatibility:

    ts
    { shims: true }  // Adds __dirname, __filename, etc.
  6. Auto-generate package.json exports:

    ts
    { exports: true }  // Creates proper exports field
  7. Use watch mode during development:

    bash
    tsdown --watch
  8. Preserve structure for utilities with many files:

    ts
    { unbundle: true }  // Keep directory structure
  9. Validate packages in CI before publishing:

    ts
    { publint: 'ci-only', attw: 'ci-only' }

Resources

© JetBrains, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 41 other files (references) in tsdown of JetBrains/skills.

  • SKILL.md
  • LICENSE.md
  • README.md
  • SYNC.md
  • references/README.md
  • references/advanced-benchmark.md
  • references/advanced-ci.md
  • references/advanced-hooks.md
  • references/advanced-plugins.md
  • references/advanced-programmatic.md
  • references/advanced-rolldown-options.md
  • references/guide-getting-started.md
  • references/guide-introduction.md
  • references/guide-migrate-from-tsup.md
  • references/option-cjs-default.md
  • references/option-cleaning.md
  • references/option-config-file.md
  • references/option-css.md
  • references/option-dependencies.md
  • references/option-dts.md
  • … and 22 more

Open the folder on GitHubat commit e0f258b

Used in 6 other repositories

We found 6 copies of this SKILL.md (exact, near-identical or edited) in other folders, from 6 other GitHub owners. This page covers the copy in JetBrains/skills, which our catalogue first saw on October 7, 2026.

Compare with similar skills

Tsdown next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Tsdown compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Tsdown this skillJetBrains/skills3636 repos~3kAutomated safety check: PassMIT
Tabler Bootstrap Component Rulestabler/tabler42k—~2.2kAutomated safety check: PassMIT
Tabler Core JavaScripttabler/tabler42k—~1.4kAutomated safety check: PassMIT
Typescript Best Practicesbretzel-app/crumbs1271 repos~2.2kAutomated safety check: PassMIT
Compare Array Bundle SizePostHog/posthog-js613—~599Automated safety check: PassCustom licence
Language Supportlive-codes/livecodes1.5k—~1.6kAutomated safety check: PassMIT

Similar skills

  • Sets the file structure, typing and Data API pattern for writing a new Bootstrap-style JavaScript component class in Tabler's vendored port of Bootstrap's JS.

    42k GitHub stars~2.2k tokensUpdated yesterday
    Frontend & DesignAuto-check passed
  • Guidance for changing the Tabler framework's own JavaScript in core/js: the tabler.js and tabler-theme.js bundles, the Bootstrap port and their tests.

    42k GitHub stars~1.4k tokensUpdated yesterday
    Frontend & DesignAuto-check passed
  • Typescript Best Practices

    bretzel-app/crumbs

    Provides TypeScript patterns for type-first development, making illegal states unrepresentable, exhaustive handling, and runtime validation.

    127 GitHub starsUsed in 1 repo~2.2k tokens
    Frontend & DesignAuto-check passed
  • Compare Array Bundle Size

    PostHog/posthog-js

    Official

    Quickly compare the posthog-js array.js bundle size in the current working tree against a git baseline using the repository's esbuild proxy.

    613 GitHub stars~599 tokensUpdated yesterday
    Frontend & DesignAuto-check passed
  • Language Support

    live-codes/livecodes

    Work with 90+ supported languages, compilers, CSS processors, and WASM-compiled languages for markup, style, and script editors.

    1.5k GitHub stars~1.6k tokensUpdated yesterday
    Frontend & DesignAuto-check passed
  • Connect Component To Figma

    dequelabs/cauldron

    Add a Figma Code Connect (.figma.tsx) file for a Cauldron React component.

    129 GitHub stars~2k tokensUpdated yesterday
    Frontend & DesignAuto-check passed

More from JetBrains/skills

All 79 skills in this repo
  • Playwright

    JetBrains/skills

    Official

    A skill your agent uses when the task requires automating a real browser from the terminal (navigation, form filling, snapshots, screenshots, data extraction, UI-flow debugging) via playwright-cli…

    363 GitHub starsUsed in 11 repos~986 tokens
    Auto-check passed
  • Skill Creator

    JetBrains/skills

    Official

    Guide for creating effective skills. An agent skill from JetBrains/skills.

    363 GitHub starsUsed in 120 repos~4.7k tokens
    Auto-check passed
  • Speech

    JetBrains/skills

    Official

    A skill your agent uses when the user asks for text-to-speech narration or voiceover, accessibility reads, audio prompts, or batch speech generation via the OpenAI Audio API; run the bundled CLI…

    363 GitHub starsUsed in 4 repos~1.9k tokens
    Auto-check passed
  • Transcribe

    JetBrains/skills

    Official

    Transcribe audio files to text with optional diarization and known-speaker hints.

    363 GitHub starsUsed in 4 repos~776 tokens
    Auto-check passed
  • Imagegen

    JetBrains/skills

    Official

    A skill your agent uses when the user asks to generate or edit images via the OpenAI Image API (for example: generate image, edit/inpaint/mask, background removal or replacement, transparent…

    363 GitHub starsUsed in 3 repos~2.5k tokens
    Auto-check passed
  • Screenshot

    JetBrains/skills

    Official

    A skill your agent uses when the user explicitly asks for a desktop or system screenshot (full screen, specific app or window, or a pixel region), or when tool-specific capture capabilities are…

    363 GitHub starsUsed in 6 repos~2k tokens
    Auto-check passed

Questions about Tsdown

What does Tsdown do?

Bundle TypeScript and JavaScript libraries with blazing-fast speed powered by Rolldown. Tsdown is an agent skill from JetBrains/skills, published by the product's own GitHub organization. Bundle TypeScript and JavaScript libraries with blazing-fast speed powered by Rolldown.

When should I use Tsdown?

Tsdown fits situations like: building libraries; generating type declarations; bundling for multiple formats; migrating from tsup.

How do I install Tsdown in Claude Code?

Run `npx skills add JetBrains/skills --skill tsdown -a claude-code`. Or copy the skill folder (tsdown in JetBrains/skills) into .claude/skills/tsdown in your project. Claude Code loads it when a task matches its description.

How do I install Tsdown in Codex?

Run `npx skills add JetBrains/skills --skill tsdown -a codex`. Or copy the skill folder (tsdown in JetBrains/skills) into .agents/skills/tsdown in your project. Codex loads it when a task matches its description.

Can I use Tsdown in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add JetBrains/skills --skill tsdown -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/tsdown, .gemini/skills/tsdown, .github/skills/tsdown and .opencode/skills/tsdown in your project.

What does Tsdown need to run?

Going by SKILL.md and its folder, Tsdown needs the command-line tools its instructions call (npx and pnpm). Our summary lists: Node.js.

Does Tsdown access the network?

SKILL.md names 3 domains. As links in the text: tsdown.dev, github.com and rolldown.rs. This is read from the text; nothing was executed.

Is Tsdown safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Tsdown use?

Tsdown is published under the MIT licence (from the LICENSE file in the skill folder). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Tsdown use?

About 3k tokens (SKILL.md is roughly 12k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 40k tokens, read only when the agent opens those files.

What are the alternatives to Tsdown?

Skills that share tags, products or a category with Tsdown: Tabler Bootstrap Component Rules (tabler/tabler, 42k stars), Tabler Core JavaScript (tabler/tabler, 42k stars), Typescript Best Practices (bretzel-app/crumbs, 127 stars) and Compare Array Bundle Size (PostHog/posthog-js, 613 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Tsdown?

JetBrains (a GitHub organization, an official publisher) maintains it in JetBrains/skills, which has 363 GitHub stars. The repository holds 79 skills in this directory. The repository was last updated on June 29, 2026.

Source: JetBrains/skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.