[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6F31QA5JBZ6T0T1HT95G34J":3,"skill-same:01M6F31QA5JBZ6T0T1HT95G34J":58},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":30,"linkOnly":31,"markdownContent":32,"markdownBody":33,"frontMatter":34,"refName":35,"commitSha":36,"skillDirectory":37,"forksCount":38,"repositoryHtmlUrl":39,"repositoryHomepageUrl":40,"ownerHtmlUrl":41,"ownerBlogUrl":6,"ownerDescription":42,"updatedAt":43,"install":44,"resources":57},"01M6F31QA5JBZ6T0T1HT95G34J","tsdown",null,"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.","ComeOnOliver\u002Fskillshub","ComeOnOliver","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F43215937?v=4","01M6E5JNFECJAAVFE0W7SMWWD2","Haoran Shu","01M6E5JNNDQS7AJZDYFQ8TPZCK",67,"MIT","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fantfu\u002Fskills\u002Ftsdown\u002FSKILL.md",[],[5,19,20,21,22,23,24,25,26,27,28,29],"typescript","javascript","libraries","fast","use","speed","type","bundle","rolldown","tsup","with","2026-11-10 10:12:30",false,"---\nname: tsdown\ndescription: 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.\n---\n\n# tsdown - The Elegant Library Bundler\n\nBlazing-fast bundler for TypeScript\u002FJavaScript libraries powered by Rolldown and Oxc.\n\n## When to Use\n\n- Building TypeScript\u002FJavaScript libraries for npm\n- Generating TypeScript declaration files (.d.ts)\n- Bundling for multiple formats (ESM, CJS, IIFE, UMD)\n- Optimizing bundles with tree shaking and minification\n- Migrating from tsup with minimal changes\n- Building React, Vue, Solid, or Svelte component libraries\n\n## Quick Start\n\n```bash\n# Install\npnpm add -D tsdown\n\n# Basic usage\nnpx tsdown\n\n# With config file\nnpx tsdown --config tsdown.config.ts\n\n# Watch mode\nnpx tsdown --watch\n\n# Migrate from tsup\nnpx tsdown-migrate\n```\n\n## Basic Configuration\n\n```ts\nimport { defineConfig } from 'tsdown'\n\nexport default defineConfig({\n  entry: ['.\u002Fsrc\u002Findex.ts'],\n  format: ['esm', 'cjs'],\n  dts: true,\n  clean: true,\n})\n```\n\n## Core References\n\n| Topic | Description | Reference |\n|-------|-------------|-----------|\n| Getting Started | Installation, first bundle, CLI basics | [guide-getting-started](references\u002Fguide-getting-started.md) |\n| Configuration File | Config file formats, multiple configs, workspace | [option-config-file](references\u002Foption-config-file.md) |\n| CLI Reference | All CLI commands and options | [reference-cli](references\u002Freference-cli.md) |\n| Migrate from tsup | Migration guide and compatibility notes | [guide-migrate-from-tsup](references\u002Fguide-migrate-from-tsup.md) |\n| Plugins | Rolldown, Rollup, Unplugin support | [advanced-plugins](references\u002Fadvanced-plugins.md) |\n| Hooks | Lifecycle hooks for custom logic | [advanced-hooks](references\u002Fadvanced-hooks.md) |\n| Programmatic API | Build from Node.js scripts | [advanced-programmatic](references\u002Fadvanced-programmatic.md) |\n| Rolldown Options | Pass options directly to Rolldown | [advanced-rolldown-options](references\u002Fadvanced-rolldown-options.md) |\n| CI Environment | CI detection, `'ci-only'` \u002F `'local-only'` values | [advanced-ci](references\u002Fadvanced-ci.md) |\n\n## Build Options\n\n| Option | Usage | Reference |\n|--------|-------|-----------|\n| Entry points | `entry: ['src\u002F*.ts', '!**\u002F*.test.ts']` | [option-entry](references\u002Foption-entry.md) |\n| Output formats | `format: ['esm', 'cjs', 'iife', 'umd']` | [option-output-format](references\u002Foption-output-format.md) |\n| Output directory | `outDir: 'dist'`, `outExtensions` | [option-output-directory](references\u002Foption-output-directory.md) |\n| Type declarations | `dts: true`, `dts: { sourcemap, compilerOptions, vue }` | [option-dts](references\u002Foption-dts.md) |\n| Target environment | `target: 'es2020'`, `target: 'esnext'` | [option-target](references\u002Foption-target.md) |\n| Platform | `platform: 'node'`, `platform: 'browser'` | [option-platform](references\u002Foption-platform.md) |\n| Tree shaking | `treeshake: true`, custom options | [option-tree-shaking](references\u002Foption-tree-shaking.md) |\n| Minification | `minify: true`, `minify: 'dce-only'` | [option-minification](references\u002Foption-minification.md) |\n| Source maps | `sourcemap: true`, `'inline'`, `'hidden'` | [option-sourcemap](references\u002Foption-sourcemap.md) |\n| Watch mode | `watch: true`, watch options | [option-watch-mode](references\u002Foption-watch-mode.md) |\n| Cleaning | `clean: true`, clean patterns | [option-cleaning](references\u002Foption-cleaning.md) |\n| Log level | `logLevel: 'silent'`, `failOnWarn: false` | [option-log-level](references\u002Foption-log-level.md) |\n\n## Dependency Handling\n\n| Feature | Usage | Reference |\n|---------|-------|-----------|\n| Never bundle | `deps: { neverBundle: ['react', \u002F^@myorg\\\u002F\u002F] }` | [option-dependencies](references\u002Foption-dependencies.md) |\n| Always bundle | `deps: { alwaysBundle: ['dep-to-bundle'] }` | [option-dependencies](references\u002Foption-dependencies.md) |\n| Only bundle | `deps: { onlyBundle: ['cac', 'bumpp'] }` - Whitelist | [option-dependencies](references\u002Foption-dependencies.md) |\n| Skip node_modules | `deps: { skipNodeModulesBundle: true }` | [option-dependencies](references\u002Foption-dependencies.md) |\n| Auto external | Automatic peer\u002Fdependency externalization | [option-dependencies](references\u002Foption-dependencies.md) |\n\n## Output Enhancement\n\n| Feature | Usage | Reference |\n|---------|-------|-----------|\n| Shims | `shims: true` - Add ESM\u002FCJS compatibility | [option-shims](references\u002Foption-shims.md) |\n| CJS default | `cjsDefault: true` (default) \u002F `false` | [option-cjs-default](references\u002Foption-cjs-default.md) |\n| Package exports | `exports: true` - Auto-generate exports field | [option-package-exports](references\u002Foption-package-exports.md) |\n| CSS handling | **[experimental]** `css: { ... }` — full pipeline with preprocessors, Lightning CSS, PostCSS, code splitting; requires `@tsdown\u002Fcss` | [option-css](references\u002Foption-css.md) |\n| CSS inject | `css: { inject: true }` — preserve CSS imports in JS output | [option-css](references\u002Foption-css.md) |\n| Unbundle mode | `unbundle: true` - Preserve directory structure | [option-unbundle](references\u002Foption-unbundle.md) |\n| Root directory | `root: 'src'` - Control output directory mapping | [option-root](references\u002Foption-root.md) |\n| Executable | **[experimental]** `exe: true` - Bundle as standalone executable, cross-platform via `@tsdown\u002Fexe` | [option-exe](references\u002Foption-exe.md) |\n| Package validation | `publint: true`, `attw: true` - Validate package | [option-lint](references\u002Foption-lint.md) |\n\n## Framework & Runtime Support\n\n| Framework | Guide | Reference |\n|-----------|-------|-----------|\n| React | JSX transform, React Compiler | [recipe-react](references\u002Frecipe-react.md) |\n| Vue | SFC support, JSX | [recipe-vue](references\u002Frecipe-vue.md) |\n| Solid | SolidJS JSX transform | [recipe-solid](references\u002Frecipe-solid.md) |\n| Svelte | Svelte component libraries (source distribution recommended) | [recipe-svelte](references\u002Frecipe-svelte.md) |\n| WASM | WebAssembly modules via `rolldown-plugin-wasm` | [recipe-wasm](references\u002Frecipe-wasm.md) |\n\n## Common Patterns\n\n### Basic Library Bundle\n\n```ts\nexport default defineConfig({\n  entry: ['src\u002Findex.ts'],\n  format: ['esm', 'cjs'],\n  dts: true,\n  clean: true,\n})\n```\n\n### Multiple Entry Points\n\n```ts\nexport default defineConfig({\n  entry: {\n    index: 'src\u002Findex.ts',\n    utils: 'src\u002Futils.ts',\n    cli: 'src\u002Fcli.ts',\n  },\n  format: ['esm', 'cjs'],\n  dts: true,\n})\n```\n\n### Browser Library (IIFE\u002FUMD)\n\n```ts\nexport default defineConfig({\n  entry: ['src\u002Findex.ts'],\n  format: ['iife'],\n  globalName: 'MyLib',\n  platform: 'browser',\n  minify: true,\n})\n```\n\n### React Component Library\n\n```ts\nexport default defineConfig({\n  entry: ['src\u002Findex.tsx'],\n  format: ['esm', 'cjs'],\n  dts: true,\n  deps: {\n    neverBundle: ['react', 'react-dom'],\n  },\n  inputOptions: {\n    jsx: { runtime: 'automatic' },\n  },\n})\n```\n\n### Preserve Directory Structure\n\n```ts\nexport default defineConfig({\n  entry: ['src\u002F**\u002F*.ts', '!**\u002F*.test.ts'],\n  unbundle: true, \u002F\u002F Preserve file structure\n  format: ['esm'],\n  dts: true,\n})\n```\n\n### CI-Aware Configuration\n\n```ts\nexport default defineConfig({\n  entry: ['src\u002Findex.ts'],\n  format: ['esm', 'cjs'],\n  dts: true,\n  failOnWarn: 'ci-only',  \u002F\u002F opt-in: fail on warnings in CI\n  publint: 'ci-only',\n  attw: 'ci-only',\n})\n```\n\n### WASM Support\n\n```ts\nimport { wasm } from 'rolldown-plugin-wasm'\nimport { defineConfig } from 'tsdown'\n\nexport default defineConfig({\n  entry: ['src\u002Findex.ts'],\n  plugins: [wasm()],\n})\n```\n\n### Library with CSS and Sass\n\n```ts\nexport default defineConfig({\n  entry: ['src\u002Findex.ts'],\n  format: ['esm', 'cjs'],\n  dts: true,\n  target: 'chrome100',\n  css: {\n    preprocessorOptions: {\n      scss: {\n        additionalData: `@use \"src\u002Fstyles\u002Fvariables\" as *;`,\n      },\n    },\n  },\n})\n```\n\n### Standalone Executable\n\n```ts\nexport default defineConfig({\n  entry: ['src\u002Fcli.ts'],\n  exe: true,\n})\n```\n\n### Cross-Platform Executable (requires `@tsdown\u002Fexe`)\n\n```ts\nexport default defineConfig({\n  entry: ['src\u002Fcli.ts'],\n  exe: {\n    targets: [\n      { platform: 'linux', arch: 'x64', nodeVersion: '25.7.0' },\n      { platform: 'darwin', arch: 'arm64', nodeVersion: '25.7.0' },\n      { platform: 'win', arch: 'x64', nodeVersion: '25.7.0' },\n    ],\n  },\n})\n```\n\n### Advanced with Hooks\n\n```ts\nexport default defineConfig({\n  entry: ['src\u002Findex.ts'],\n  format: ['esm', 'cjs'],\n  dts: true,\n  hooks: {\n    'build:before': async (context) => {\n      console.log('Building...')\n    },\n    'build:done': async (context) => {\n      console.log('Build complete!')\n    },\n  },\n})\n```\n\n## Configuration Features\n\n### Multiple Configs\n\nExport an array for multiple build configurations:\n\n```ts\nexport default defineConfig([\n  {\n    entry: ['src\u002Findex.ts'],\n    format: ['esm', 'cjs'],\n    dts: true,\n  },\n  {\n    entry: ['src\u002Fcli.ts'],\n    format: ['esm'],\n    platform: 'node',\n  },\n])\n```\n\n### Conditional Config\n\nUse functions for dynamic configuration:\n\n```ts\nexport default defineConfig((options) => {\n  const isDev = options.watch\n  return {\n    entry: ['src\u002Findex.ts'],\n    format: ['esm', 'cjs'],\n    minify: !isDev,\n    sourcemap: isDev,\n  }\n})\n```\n\n### Workspace\u002FMonorepo\n\nUse glob patterns to build multiple packages:\n\n```ts\nexport default defineConfig({\n  workspace: 'packages\u002F*',\n  entry: ['src\u002Findex.ts'],\n  format: ['esm', 'cjs'],\n  dts: true,\n})\n```\n\n## CLI Quick Reference\n\n```bash\n# Basic commands\ntsdown                          # Build once\ntsdown --watch                  # Watch mode\ntsdown --config custom.ts       # Custom config\nnpx tsdown-migrate              # Migrate from tsup\n\n# Output options\ntsdown --format esm,cjs        # Multiple formats\ntsdown -d lib                  # Custom output directory (--out-dir)\ntsdown --minify                # Enable minification\ntsdown --dts                   # Generate declarations\ntsdown --exe                   # Bundle as standalone executable\ntsdown --unbundle              # Bundleless mode\n\n# Entry options\ntsdown src\u002Findex.ts            # Single entry\ntsdown src\u002F*.ts                # Glob patterns\ntsdown src\u002Fa.ts src\u002Fb.ts       # Multiple entries\n\n# Workspace \u002F Monorepo\ntsdown -W                      # Enable workspace mode\ntsdown -W -F my-package        # Filter specific package\ntsdown --filter \u002F^pkg-\u002F        # Filter by regex\n\n# Development\ntsdown --watch                 # Watch mode\ntsdown --sourcemap             # Generate source maps\ntsdown --clean                 # Clean output directory\ntsdown --from-vite             # Reuse Vite config\ntsdown --tsconfig tsconfig.build.json  # Custom tsconfig\n```\n\n## Best Practices\n\n1. **Always generate type declarations** for TypeScript libraries:\n   ```ts\n   { dts: true }\n   ```\n\n2. **Externalize dependencies** to avoid bundling unnecessary code:\n   ```ts\n   { deps: { neverBundle: [\u002F^react\u002F, \u002F^@myorg\\\u002F\u002F] } }\n   ```\n\n3. **Use tree shaking** for optimal bundle size:\n   ```ts\n   { treeshake: true }\n   ```\n\n4. **Enable minification** for production builds:\n   ```ts\n   { minify: true }\n   ```\n\n5. **Add shims** for better ESM\u002FCJS compatibility:\n   ```ts\n   { shims: true }  \u002F\u002F Adds __dirname, __filename, etc.\n   ```\n\n6. **Auto-generate package.json exports**:\n   ```ts\n   { exports: true }  \u002F\u002F Creates proper exports field\n   ```\n\n7. **Use watch mode** during development:\n   ```bash\n   tsdown --watch\n   ```\n\n8. **Preserve structure** for utilities with many files:\n   ```ts\n   { unbundle: true }  \u002F\u002F Keep directory structure\n   ```\n\n9. **Validate packages** in CI before publishing:\n   ```ts\n   { publint: 'ci-only', attw: 'ci-only' }\n   ```\n\n## Resources\n\n- Documentation: https:\u002F\u002Ftsdown.dev\n- GitHub: https:\u002F\u002Fgithub.com\u002Frolldown\u002Ftsdown\n- Rolldown: https:\u002F\u002Frolldown.rs\n- Migration Guide: https:\u002F\u002Ftsdown.dev\u002Fguide\u002Fmigrate-from-tsup\n\n","# tsdown - The Elegant Library Bundler\n\nBlazing-fast bundler for TypeScript\u002FJavaScript libraries powered by Rolldown and Oxc.\n\n## When to Use\n\n- Building TypeScript\u002FJavaScript libraries for npm\n- Generating TypeScript declaration files (.d.ts)\n- Bundling for multiple formats (ESM, CJS, IIFE, UMD)\n- Optimizing bundles with tree shaking and minification\n- Migrating from tsup with minimal changes\n- Building React, Vue, Solid, or Svelte component libraries\n\n## Quick Start\n\n```bash\n# Install\npnpm add -D tsdown\n\n# Basic usage\nnpx tsdown\n\n# With config file\nnpx tsdown --config tsdown.config.ts\n\n# Watch mode\nnpx tsdown --watch\n\n# Migrate from tsup\nnpx tsdown-migrate\n```\n\n## Basic Configuration\n\n```ts\nimport { defineConfig } from 'tsdown'\n\nexport default defineConfig({\n  entry: ['.\u002Fsrc\u002Findex.ts'],\n  format: ['esm', 'cjs'],\n  dts: true,\n  clean: true,\n})\n```\n\n## Core References\n\n| Topic | Description | Reference |\n|-------|-------------|-----------|\n| Getting Started | Installation, first bundle, CLI basics | [guide-getting-started](references\u002Fguide-getting-started.md) |\n| Configuration File | Config file formats, multiple configs, workspace | [option-config-file](references\u002Foption-config-file.md) |\n| CLI Reference | All CLI commands and options | [reference-cli](references\u002Freference-cli.md) |\n| Migrate from tsup | Migration guide and compatibility notes | [guide-migrate-from-tsup](references\u002Fguide-migrate-from-tsup.md) |\n| Plugins | Rolldown, Rollup, Unplugin support | [advanced-plugins](references\u002Fadvanced-plugins.md) |\n| Hooks | Lifecycle hooks for custom logic | [advanced-hooks](references\u002Fadvanced-hooks.md) |\n| Programmatic API | Build from Node.js scripts | [advanced-programmatic](references\u002Fadvanced-programmatic.md) |\n| Rolldown Options | Pass options directly to Rolldown | [advanced-rolldown-options](references\u002Fadvanced-rolldown-options.md) |\n| CI Environment | CI detection, `'ci-only'` \u002F `'local-only'` values | [advanced-ci](references\u002Fadvanced-ci.md) |\n\n## Build Options\n\n| Option | Usage | Reference |\n|--------|-------|-----------|\n| Entry points | `entry: ['src\u002F*.ts', '!**\u002F*.test.ts']` | [option-entry](references\u002Foption-entry.md) |\n| Output formats | `format: ['esm', 'cjs', 'iife', 'umd']` | [option-output-format](references\u002Foption-output-format.md) |\n| Output directory | `outDir: 'dist'`, `outExtensions` | [option-output-directory](references\u002Foption-output-directory.md) |\n| Type declarations | `dts: true`, `dts: { sourcemap, compilerOptions, vue }` | [option-dts](references\u002Foption-dts.md) |\n| Target environment | `target: 'es2020'`, `target: 'esnext'` | [option-target](references\u002Foption-target.md) |\n| Platform | `platform: 'node'`, `platform: 'browser'` | [option-platform](references\u002Foption-platform.md) |\n| Tree shaking | `treeshake: true`, custom options | [option-tree-shaking](references\u002Foption-tree-shaking.md) |\n| Minification | `minify: true`, `minify: 'dce-only'` | [option-minification](references\u002Foption-minification.md) |\n| Source maps | `sourcemap: true`, `'inline'`, `'hidden'` | [option-sourcemap](references\u002Foption-sourcemap.md) |\n| Watch mode | `watch: true`, watch options | [option-watch-mode](references\u002Foption-watch-mode.md) |\n| Cleaning | `clean: true`, clean patterns | [option-cleaning](references\u002Foption-cleaning.md) |\n| Log level | `logLevel: 'silent'`, `failOnWarn: false` | [option-log-level](references\u002Foption-log-level.md) |\n\n## Dependency Handling\n\n| Feature | Usage | Reference |\n|---------|-------|-----------|\n| Never bundle | `deps: { neverBundle: ['react', \u002F^@myorg\\\u002F\u002F] }` | [option-dependencies](references\u002Foption-dependencies.md) |\n| Always bundle | `deps: { alwaysBundle: ['dep-to-bundle'] }` | [option-dependencies](references\u002Foption-dependencies.md) |\n| Only bundle | `deps: { onlyBundle: ['cac', 'bumpp'] }` - Whitelist | [option-dependencies](references\u002Foption-dependencies.md) |\n| Skip node_modules | `deps: { skipNodeModulesBundle: true }` | [option-dependencies](references\u002Foption-dependencies.md) |\n| Auto external | Automatic peer\u002Fdependency externalization | [option-dependencies](references\u002Foption-dependencies.md) |\n\n## Output Enhancement\n\n| Feature | Usage | Reference |\n|---------|-------|-----------|\n| Shims | `shims: true` - Add ESM\u002FCJS compatibility | [option-shims](references\u002Foption-shims.md) |\n| CJS default | `cjsDefault: true` (default) \u002F `false` | [option-cjs-default](references\u002Foption-cjs-default.md) |\n| Package exports | `exports: true` - Auto-generate exports field | [option-package-exports](references\u002Foption-package-exports.md) |\n| CSS handling | **[experimental]** `css: { ... }` — full pipeline with preprocessors, Lightning CSS, PostCSS, code splitting; requires `@tsdown\u002Fcss` | [option-css](references\u002Foption-css.md) |\n| CSS inject | `css: { inject: true }` — preserve CSS imports in JS output | [option-css](references\u002Foption-css.md) |\n| Unbundle mode | `unbundle: true` - Preserve directory structure | [option-unbundle](references\u002Foption-unbundle.md) |\n| Root directory | `root: 'src'` - Control output directory mapping | [option-root](references\u002Foption-root.md) |\n| Executable | **[experimental]** `exe: true` - Bundle as standalone executable, cross-platform via `@tsdown\u002Fexe` | [option-exe](references\u002Foption-exe.md) |\n| Package validation | `publint: true`, `attw: true` - Validate package | [option-lint](references\u002Foption-lint.md) |\n\n## Framework & Runtime Support\n\n| Framework | Guide | Reference |\n|-----------|-------|-----------|\n| React | JSX transform, React Compiler | [recipe-react](references\u002Frecipe-react.md) |\n| Vue | SFC support, JSX | [recipe-vue](references\u002Frecipe-vue.md) |\n| Solid | SolidJS JSX transform | [recipe-solid](references\u002Frecipe-solid.md) |\n| Svelte | Svelte component libraries (source distribution recommended) | [recipe-svelte](references\u002Frecipe-svelte.md) |\n| WASM | WebAssembly modules via `rolldown-plugin-wasm` | [recipe-wasm](references\u002Frecipe-wasm.md) |\n\n## Common Patterns\n\n### Basic Library Bundle\n\n```ts\nexport default defineConfig({\n  entry: ['src\u002Findex.ts'],\n  format: ['esm', 'cjs'],\n  dts: true,\n  clean: true,\n})\n```\n\n### Multiple Entry Points\n\n```ts\nexport default defineConfig({\n  entry: {\n    index: 'src\u002Findex.ts',\n    utils: 'src\u002Futils.ts',\n    cli: 'src\u002Fcli.ts',\n  },\n  format: ['esm', 'cjs'],\n  dts: true,\n})\n```\n\n### Browser Library (IIFE\u002FUMD)\n\n```ts\nexport default defineConfig({\n  entry: ['src\u002Findex.ts'],\n  format: ['iife'],\n  globalName: 'MyLib',\n  platform: 'browser',\n  minify: true,\n})\n```\n\n### React Component Library\n\n```ts\nexport default defineConfig({\n  entry: ['src\u002Findex.tsx'],\n  format: ['esm', 'cjs'],\n  dts: true,\n  deps: {\n    neverBundle: ['react', 'react-dom'],\n  },\n  inputOptions: {\n    jsx: { runtime: 'automatic' },\n  },\n})\n```\n\n### Preserve Directory Structure\n\n```ts\nexport default defineConfig({\n  entry: ['src\u002F**\u002F*.ts', '!**\u002F*.test.ts'],\n  unbundle: true, \u002F\u002F Preserve file structure\n  format: ['esm'],\n  dts: true,\n})\n```\n\n### CI-Aware Configuration\n\n```ts\nexport default defineConfig({\n  entry: ['src\u002Findex.ts'],\n  format: ['esm', 'cjs'],\n  dts: true,\n  failOnWarn: 'ci-only',  \u002F\u002F opt-in: fail on warnings in CI\n  publint: 'ci-only',\n  attw: 'ci-only',\n})\n```\n\n### WASM Support\n\n```ts\nimport { wasm } from 'rolldown-plugin-wasm'\nimport { defineConfig } from 'tsdown'\n\nexport default defineConfig({\n  entry: ['src\u002Findex.ts'],\n  plugins: [wasm()],\n})\n```\n\n### Library with CSS and Sass\n\n```ts\nexport default defineConfig({\n  entry: ['src\u002Findex.ts'],\n  format: ['esm', 'cjs'],\n  dts: true,\n  target: 'chrome100',\n  css: {\n    preprocessorOptions: {\n      scss: {\n        additionalData: `@use \"src\u002Fstyles\u002Fvariables\" as *;`,\n      },\n    },\n  },\n})\n```\n\n### Standalone Executable\n\n```ts\nexport default defineConfig({\n  entry: ['src\u002Fcli.ts'],\n  exe: true,\n})\n```\n\n### Cross-Platform Executable (requires `@tsdown\u002Fexe`)\n\n```ts\nexport default defineConfig({\n  entry: ['src\u002Fcli.ts'],\n  exe: {\n    targets: [\n      { platform: 'linux', arch: 'x64', nodeVersion: '25.7.0' },\n      { platform: 'darwin', arch: 'arm64', nodeVersion: '25.7.0' },\n      { platform: 'win', arch: 'x64', nodeVersion: '25.7.0' },\n    ],\n  },\n})\n```\n\n### Advanced with Hooks\n\n```ts\nexport default defineConfig({\n  entry: ['src\u002Findex.ts'],\n  format: ['esm', 'cjs'],\n  dts: true,\n  hooks: {\n    'build:before': async (context) => {\n      console.log('Building...')\n    },\n    'build:done': async (context) => {\n      console.log('Build complete!')\n    },\n  },\n})\n```\n\n## Configuration Features\n\n### Multiple Configs\n\nExport an array for multiple build configurations:\n\n```ts\nexport default defineConfig([\n  {\n    entry: ['src\u002Findex.ts'],\n    format: ['esm', 'cjs'],\n    dts: true,\n  },\n  {\n    entry: ['src\u002Fcli.ts'],\n    format: ['esm'],\n    platform: 'node',\n  },\n])\n```\n\n### Conditional Config\n\nUse functions for dynamic configuration:\n\n```ts\nexport default defineConfig((options) => {\n  const isDev = options.watch\n  return {\n    entry: ['src\u002Findex.ts'],\n    format: ['esm', 'cjs'],\n    minify: !isDev,\n    sourcemap: isDev,\n  }\n})\n```\n\n### Workspace\u002FMonorepo\n\nUse glob patterns to build multiple packages:\n\n```ts\nexport default defineConfig({\n  workspace: 'packages\u002F*',\n  entry: ['src\u002Findex.ts'],\n  format: ['esm', 'cjs'],\n  dts: true,\n})\n```\n\n## CLI Quick Reference\n\n```bash\n# Basic commands\ntsdown                          # Build once\ntsdown --watch                  # Watch mode\ntsdown --config custom.ts       # Custom config\nnpx tsdown-migrate              # Migrate from tsup\n\n# Output options\ntsdown --format esm,cjs        # Multiple formats\ntsdown -d lib                  # Custom output directory (--out-dir)\ntsdown --minify                # Enable minification\ntsdown --dts                   # Generate declarations\ntsdown --exe                   # Bundle as standalone executable\ntsdown --unbundle              # Bundleless mode\n\n# Entry options\ntsdown src\u002Findex.ts            # Single entry\ntsdown src\u002F*.ts                # Glob patterns\ntsdown src\u002Fa.ts src\u002Fb.ts       # Multiple entries\n\n# Workspace \u002F Monorepo\ntsdown -W                      # Enable workspace mode\ntsdown -W -F my-package        # Filter specific package\ntsdown --filter \u002F^pkg-\u002F        # Filter by regex\n\n# Development\ntsdown --watch                 # Watch mode\ntsdown --sourcemap             # Generate source maps\ntsdown --clean                 # Clean output directory\ntsdown --from-vite             # Reuse Vite config\ntsdown --tsconfig tsconfig.build.json  # Custom tsconfig\n```\n\n## Best Practices\n\n1. **Always generate type declarations** for TypeScript libraries:\n   ```ts\n   { dts: true }\n   ```\n\n2. **Externalize dependencies** to avoid bundling unnecessary code:\n   ```ts\n   { deps: { neverBundle: [\u002F^react\u002F, \u002F^@myorg\\\u002F\u002F] } }\n   ```\n\n3. **Use tree shaking** for optimal bundle size:\n   ```ts\n   { treeshake: true }\n   ```\n\n4. **Enable minification** for production builds:\n   ```ts\n   { minify: true }\n   ```\n\n5. **Add shims** for better ESM\u002FCJS compatibility:\n   ```ts\n   { shims: true }  \u002F\u002F Adds __dirname, __filename, etc.\n   ```\n\n6. **Auto-generate package.json exports**:\n   ```ts\n   { exports: true }  \u002F\u002F Creates proper exports field\n   ```\n\n7. **Use watch mode** during development:\n   ```bash\n   tsdown --watch\n   ```\n\n8. **Preserve structure** for utilities with many files:\n   ```ts\n   { unbundle: true }  \u002F\u002F Keep directory structure\n   ```\n\n9. **Validate packages** in CI before publishing:\n   ```ts\n   { publint: 'ci-only', attw: 'ci-only' }\n   ```\n\n## Resources\n\n- Documentation: https:\u002F\u002Ftsdown.dev\n- GitHub: https:\u002F\u002Fgithub.com\u002Frolldown\u002Ftsdown\n- Rolldown: https:\u002F\u002Frolldown.rs\n- Migration Guide: https:\u002F\u002Ftsdown.dev\u002Fguide\u002Fmigrate-from-tsup\n\n",{"name":5,"description":7},"main","def8531e65114c0fca8fb8551c1871ee0eed705c","skills\u002Fantfu\u002Fskills\u002Ftsdown",24,"https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub","https:\u002F\u002Fskillshub.wtf","https:\u002F\u002Fgithub.com\u002FComeOnOliver","AI & Blockchain Engineer\r\n","2026-06-24 22:07:19",{"source":8,"skillName":5,"commands":45,"prompt":55,"zipAvailable":56},[46,49,52],{"tool":47,"command":48},"npx","npx skills add ComeOnOliver\u002Fskillshub --skill tsdown",{"tool":50,"command":51},"bunx","bunx skills add ComeOnOliver\u002Fskillshub --skill tsdown",{"tool":53,"command":54},"pnpm","pnpm dlx skills add ComeOnOliver\u002Fskillshub --skill tsdown","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fantfu\u002Fskills\u002Ftsdown\u002FSKILL.md",true,[],[59,68,77,86,92,98],{"skillNo":60,"name":61,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":62,"categories":63,"keywords":64,"publishedAt":30},"01M6FKJN13GMG4KY57J3QD8GY5","model-hierarchy-skill","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzscole\u002Fmodel-hierarchy-skill\u002Fmodel-hierarchy-skill\u002FSKILL.md",[],[65,66,67],"model","model hierarchy","model hierarchy skill",{"skillNo":69,"name":70,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":71,"categories":72,"keywords":73,"publishedAt":30},"01M6FKJJJ6GCAMR4PPPRD12M5X","zoom-mcp","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fzoom-mcp\u002FSKILL.md",[],[74,75,76],"MCP","zoom","zoom mcp",{"skillNo":78,"name":79,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":80,"categories":81,"keywords":82,"publishedAt":30},"01M6FKJE3KYT3KPEZMEEHYKA6K","zoom-apps-sdk","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fzoom-apps-sdk\u002FSKILL.md",[],[83,84,85,75],"sdk","zoom apps sdk","apps",{"skillNo":87,"name":88,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":89,"categories":90,"keywords":91,"publishedAt":30},"01M6FKJ9EDH9Q5VWDF8HAJRSP0","windows","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fwindows\u002FSKILL.md",[],[88],{"skillNo":93,"name":94,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":95,"categories":96,"keywords":97,"publishedAt":30},"01M6FKJ666BEEFC3AE9GJ72Q93","whiteboard","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fwhiteboard\u002FSKILL.md",[],[94],{"skillNo":99,"name":100,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":101,"categories":102,"keywords":103,"publishedAt":30},"01M6FKJ21WFCDGTJQ2Q91T9DVW","websockets","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fwebsockets\u002FSKILL.md",[],[100]]