[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6CNTTFMTT1JW4VEBH7JFBXE":3,"skill-same:01M6CNTTFMTT1JW4VEBH7JFBXE":183},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":15,"categories":16,"keywords":17,"publishedAt":23,"linkOnly":24,"markdownContent":25,"markdownBody":26,"frontMatter":27,"refName":28,"commitSha":29,"skillDirectory":30,"forksCount":31,"repositoryHtmlUrl":32,"repositoryHomepageUrl":6,"ownerHtmlUrl":33,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":34,"install":35,"resources":48},"01M6CNTTFMTT1JW4VEBH7JFBXE","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.","pi-ohm\u002Fpi-ohm","pi-ohm","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F262023816?v=4","01M6CNTCE7T5BD4AE48NFEWH81","01M6CNTCJ83RRVSF9QX0EDR06G",2,"MIT","https:\u002F\u002Fgithub.com\u002Fpi-ohm\u002Fpi-ohm\u002Fblob\u002Fdev\u002F.agents\u002Fskills\u002Ftsdown\u002FSKILL.md",[],[5,18,19,20,21,22],"typescript","javascript","libraries","fast","use","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: 'ci-only'`           | [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 allow bundle | `deps: { onlyAllowBundle: ['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]** Still in development          | [option-css](references\u002Foption-css.md)                         |\n| Unbundle mode      | `unbundle: true` - Preserve directory structure  | [option-unbundle](references\u002Foption-unbundle.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, Fast Refresh                    | [recipe-react](references\u002Frecipe-react.md) |\n| Vue       | SFC support, JSX                               | [recipe-vue](references\u002Frecipe-vue.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  plugins: [\n    \u002F\u002F React Fast Refresh support\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\",\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### 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 --outDir lib            # Custom output directory\ntsdown --minify                # Enable minification\ntsdown --dts                   # Generate declarations\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# Development\ntsdown --watch                 # Watch mode\ntsdown --sourcemap             # Generate source maps\ntsdown --clean                 # Clean output directory\n```\n\n## Best Practices\n\n1. **Always generate type declarations** for TypeScript libraries:\n\n   ```ts\n   {\n     dts: true;\n   }\n   ```\n\n2. **Externalize dependencies** to avoid bundling unnecessary code:\n\n   ```ts\n   {\n     deps: {\n       neverBundle: [\u002F^react\u002F, \u002F^@myorg\\\u002F\u002F];\n     }\n   }\n   ```\n\n3. **Use tree shaking** for optimal bundle size:\n\n   ```ts\n   {\n     treeshake: true;\n   }\n   ```\n\n4. **Enable minification** for production builds:\n\n   ```ts\n   {\n     minify: true;\n   }\n   ```\n\n5. **Add shims** for better ESM\u002FCJS compatibility:\n\n   ```ts\n   {\n     shims: true;\n   } \u002F\u002F Adds __dirname, __filename, etc.\n   ```\n\n6. **Auto-generate package.json exports**:\n\n   ```ts\n   {\n     exports: true;\n   } \u002F\u002F Creates proper exports field\n   ```\n\n7. **Use watch mode** during development:\n\n   ```bash\n   tsdown --watch\n   ```\n\n8. **Preserve structure** for utilities with many files:\n\n   ```ts\n   {\n     unbundle: true;\n   } \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","# 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: 'ci-only'`           | [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 allow bundle | `deps: { onlyAllowBundle: ['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]** Still in development          | [option-css](references\u002Foption-css.md)                         |\n| Unbundle mode      | `unbundle: true` - Preserve directory structure  | [option-unbundle](references\u002Foption-unbundle.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, Fast Refresh                    | [recipe-react](references\u002Frecipe-react.md) |\n| Vue       | SFC support, JSX                               | [recipe-vue](references\u002Frecipe-vue.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  plugins: [\n    \u002F\u002F React Fast Refresh support\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\",\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### 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 --outDir lib            # Custom output directory\ntsdown --minify                # Enable minification\ntsdown --dts                   # Generate declarations\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# Development\ntsdown --watch                 # Watch mode\ntsdown --sourcemap             # Generate source maps\ntsdown --clean                 # Clean output directory\n```\n\n## Best Practices\n\n1. **Always generate type declarations** for TypeScript libraries:\n\n   ```ts\n   {\n     dts: true;\n   }\n   ```\n\n2. **Externalize dependencies** to avoid bundling unnecessary code:\n\n   ```ts\n   {\n     deps: {\n       neverBundle: [\u002F^react\u002F, \u002F^@myorg\\\u002F\u002F];\n     }\n   }\n   ```\n\n3. **Use tree shaking** for optimal bundle size:\n\n   ```ts\n   {\n     treeshake: true;\n   }\n   ```\n\n4. **Enable minification** for production builds:\n\n   ```ts\n   {\n     minify: true;\n   }\n   ```\n\n5. **Add shims** for better ESM\u002FCJS compatibility:\n\n   ```ts\n   {\n     shims: true;\n   } \u002F\u002F Adds __dirname, __filename, etc.\n   ```\n\n6. **Auto-generate package.json exports**:\n\n   ```ts\n   {\n     exports: true;\n   } \u002F\u002F Creates proper exports field\n   ```\n\n7. **Use watch mode** during development:\n\n   ```bash\n   tsdown --watch\n   ```\n\n8. **Preserve structure** for utilities with many files:\n\n   ```ts\n   {\n     unbundle: true;\n   } \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",{"name":5,"description":7},"dev","ed016badd38d092bc11a87accdf64e60631337c2",".agents\u002Fskills\u002Ftsdown",1,"https:\u002F\u002Fgithub.com\u002Fpi-ohm\u002Fpi-ohm","https:\u002F\u002Fgithub.com\u002Fpi-ohm","2026-06-24 00:53:12",{"source":8,"skillName":5,"commands":36,"prompt":46,"zipAvailable":47},[37,40,43],{"tool":38,"command":39},"npx","npx skills add pi-ohm\u002Fpi-ohm --skill tsdown",{"tool":41,"command":42},"bunx","bunx skills add pi-ohm\u002Fpi-ohm --skill tsdown",{"tool":44,"command":45},"pnpm","pnpm dlx skills add pi-ohm\u002Fpi-ohm --skill tsdown","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fpi-ohm\u002Fpi-ohm\u002Fblob\u002Fdev\u002F.agents\u002Fskills\u002Ftsdown\u002FSKILL.md",true,[49,55,59,63,67,71,75,79,83,87,91,95,99,103,107,111,115,119,123,127,131,135,139,143,147,151,155,159,163,167,171,175,179],{"path":50,"resourceType":51,"resourceTypeDesc":52,"sizeBytes":53,"sourceHtmlUrl":54},"README.md","REFERENCE","参考文档",1904,"https:\u002F\u002Fgithub.com\u002Fpi-ohm\u002Fpi-ohm\u002Fblob\u002Fdev\u002F.agents\u002Fskills\u002Ftsdown\u002FREADME.md",{"path":56,"resourceType":51,"resourceTypeDesc":52,"sizeBytes":57,"sourceHtmlUrl":58},"references\u002Fadvanced-ci.md",2186,"https:\u002F\u002Fgithub.com\u002Fpi-ohm\u002Fpi-ohm\u002Fblob\u002Fdev\u002F.agents\u002Fskills\u002Ftsdown\u002Freferences\u002Fadvanced-ci.md",{"path":60,"resourceType":51,"resourceTypeDesc":52,"sizeBytes":61,"sourceHtmlUrl":62},"references\u002Fadvanced-hooks.md",7112,"https:\u002F\u002Fgithub.com\u002Fpi-ohm\u002Fpi-ohm\u002Fblob\u002Fdev\u002F.agents\u002Fskills\u002Ftsdown\u002Freferences\u002Fadvanced-hooks.md",{"path":64,"resourceType":51,"resourceTypeDesc":52,"sizeBytes":65,"sourceHtmlUrl":66},"references\u002Fadvanced-plugins.md",6782,"https:\u002F\u002Fgithub.com\u002Fpi-ohm\u002Fpi-ohm\u002Fblob\u002Fdev\u002F.agents\u002Fskills\u002Ftsdown\u002Freferences\u002Fadvanced-plugins.md",{"path":68,"resourceType":51,"resourceTypeDesc":52,"sizeBytes":69,"sourceHtmlUrl":70},"references\u002Fadvanced-programmatic.md",6149,"https:\u002F\u002Fgithub.com\u002Fpi-ohm\u002Fpi-ohm\u002Fblob\u002Fdev\u002F.agents\u002Fskills\u002Ftsdown\u002Freferences\u002Fadvanced-programmatic.md",{"path":72,"resourceType":51,"resourceTypeDesc":52,"sizeBytes":73,"sourceHtmlUrl":74},"references\u002Fadvanced-rolldown-options.md",2381,"https:\u002F\u002Fgithub.com\u002Fpi-ohm\u002Fpi-ohm\u002Fblob\u002Fdev\u002F.agents\u002Fskills\u002Ftsdown\u002Freferences\u002Fadvanced-rolldown-options.md",{"path":76,"resourceType":51,"resourceTypeDesc":52,"sizeBytes":77,"sourceHtmlUrl":78},"references\u002Fguide-getting-started.md",2667,"https:\u002F\u002Fgithub.com\u002Fpi-ohm\u002Fpi-ohm\u002Fblob\u002Fdev\u002F.agents\u002Fskills\u002Ftsdown\u002Freferences\u002Fguide-getting-started.md",{"path":80,"resourceType":51,"resourceTypeDesc":52,"sizeBytes":81,"sourceHtmlUrl":82},"references\u002Fguide-migrate-from-tsup.md",4479,"https:\u002F\u002Fgithub.com\u002Fpi-ohm\u002Fpi-ohm\u002Fblob\u002Fdev\u002F.agents\u002Fskills\u002Ftsdown\u002Freferences\u002Fguide-migrate-from-tsup.md",{"path":84,"resourceType":51,"resourceTypeDesc":52,"sizeBytes":85,"sourceHtmlUrl":86},"references\u002Foption-cjs-default.md",1952,"https:\u002F\u002Fgithub.com\u002Fpi-ohm\u002Fpi-ohm\u002Fblob\u002Fdev\u002F.agents\u002Fskills\u002Ftsdown\u002Freferences\u002Foption-cjs-default.md",{"path":88,"resourceType":51,"resourceTypeDesc":52,"sizeBytes":89,"sourceHtmlUrl":90},"references\u002Foption-cleaning.md",4881,"https:\u002F\u002Fgithub.com\u002Fpi-ohm\u002Fpi-ohm\u002Fblob\u002Fdev\u002F.agents\u002Fskills\u002Ftsdown\u002Freferences\u002Foption-cleaning.md",{"path":92,"resourceType":51,"resourceTypeDesc":52,"sizeBytes":93,"sourceHtmlUrl":94},"references\u002Foption-config-file.md",5281,"https:\u002F\u002Fgithub.com\u002Fpi-ohm\u002Fpi-ohm\u002Fblob\u002Fdev\u002F.agents\u002Fskills\u002Ftsdown\u002Freferences\u002Foption-config-file.md",{"path":96,"resourceType":51,"resourceTypeDesc":52,"sizeBytes":97,"sourceHtmlUrl":98},"references\u002Foption-css.md",284,"https:\u002F\u002Fgithub.com\u002Fpi-ohm\u002Fpi-ohm\u002Fblob\u002Fdev\u002F.agents\u002Fskills\u002Ftsdown\u002Freferences\u002Foption-css.md",{"path":100,"resourceType":51,"resourceTypeDesc":52,"sizeBytes":101,"sourceHtmlUrl":102},"references\u002Foption-dependencies.md",7488,"https:\u002F\u002Fgithub.com\u002Fpi-ohm\u002Fpi-ohm\u002Fblob\u002Fdev\u002F.agents\u002Fskills\u002Ftsdown\u002Freferences\u002Foption-dependencies.md",{"path":104,"resourceType":51,"resourceTypeDesc":52,"sizeBytes":105,"sourceHtmlUrl":106},"references\u002Foption-dts.md",5155,"https:\u002F\u002Fgithub.com\u002Fpi-ohm\u002Fpi-ohm\u002Fblob\u002Fdev\u002F.agents\u002Fskills\u002Ftsdown\u002Freferences\u002Foption-dts.md",{"path":108,"resourceType":51,"resourceTypeDesc":52,"sizeBytes":109,"sourceHtmlUrl":110},"references\u002Foption-entry.md",3672,"https:\u002F\u002Fgithub.com\u002Fpi-ohm\u002Fpi-ohm\u002Fblob\u002Fdev\u002F.agents\u002Fskills\u002Ftsdown\u002Freferences\u002Foption-entry.md",{"path":112,"resourceType":51,"resourceTypeDesc":52,"sizeBytes":113,"sourceHtmlUrl":114},"references\u002Foption-lint.md",3494,"https:\u002F\u002Fgithub.com\u002Fpi-ohm\u002Fpi-ohm\u002Fblob\u002Fdev\u002F.agents\u002Fskills\u002Ftsdown\u002Freferences\u002Foption-lint.md",{"path":116,"resourceType":51,"resourceTypeDesc":52,"sizeBytes":117,"sourceHtmlUrl":118},"references\u002Foption-log-level.md",1959,"https:\u002F\u002Fgithub.com\u002Fpi-ohm\u002Fpi-ohm\u002Fblob\u002Fdev\u002F.agents\u002Fskills\u002Ftsdown\u002Freferences\u002Foption-log-level.md",{"path":120,"resourceType":51,"resourceTypeDesc":52,"sizeBytes":121,"sourceHtmlUrl":122},"references\u002Foption-minification.md",3592,"https:\u002F\u002Fgithub.com\u002Fpi-ohm\u002Fpi-ohm\u002Fblob\u002Fdev\u002F.agents\u002Fskills\u002Ftsdown\u002Freferences\u002Foption-minification.md",{"path":124,"resourceType":51,"resourceTypeDesc":52,"sizeBytes":125,"sourceHtmlUrl":126},"references\u002Foption-output-directory.md",4622,"https:\u002F\u002Fgithub.com\u002Fpi-ohm\u002Fpi-ohm\u002Fblob\u002Fdev\u002F.agents\u002Fskills\u002Ftsdown\u002Freferences\u002Foption-output-directory.md",{"path":128,"resourceType":51,"resourceTypeDesc":52,"sizeBytes":129,"sourceHtmlUrl":130},"references\u002Foption-output-format.md",3831,"https:\u002F\u002Fgithub.com\u002Fpi-ohm\u002Fpi-ohm\u002Fblob\u002Fdev\u002F.agents\u002Fskills\u002Ftsdown\u002Freferences\u002Foption-output-format.md",{"path":132,"resourceType":51,"resourceTypeDesc":52,"sizeBytes":133,"sourceHtmlUrl":134},"references\u002Foption-package-exports.md",5313,"https:\u002F\u002Fgithub.com\u002Fpi-ohm\u002Fpi-ohm\u002Fblob\u002Fdev\u002F.agents\u002Fskills\u002Ftsdown\u002Freferences\u002Foption-package-exports.md",{"path":136,"resourceType":51,"resourceTypeDesc":52,"sizeBytes":137,"sourceHtmlUrl":138},"references\u002Foption-platform.md",5492,"https:\u002F\u002Fgithub.com\u002Fpi-ohm\u002Fpi-ohm\u002Fblob\u002Fdev\u002F.agents\u002Fskills\u002Ftsdown\u002Freferences\u002Foption-platform.md",{"path":140,"resourceType":51,"resourceTypeDesc":52,"sizeBytes":141,"sourceHtmlUrl":142},"references\u002Foption-shims.md",5625,"https:\u002F\u002Fgithub.com\u002Fpi-ohm\u002Fpi-ohm\u002Fblob\u002Fdev\u002F.agents\u002Fskills\u002Ftsdown\u002Freferences\u002Foption-shims.md",{"path":144,"resourceType":51,"resourceTypeDesc":52,"sizeBytes":145,"sourceHtmlUrl":146},"references\u002Foption-sourcemap.md",5634,"https:\u002F\u002Fgithub.com\u002Fpi-ohm\u002Fpi-ohm\u002Fblob\u002Fdev\u002F.agents\u002Fskills\u002Ftsdown\u002Freferences\u002Foption-sourcemap.md",{"path":148,"resourceType":51,"resourceTypeDesc":52,"sizeBytes":149,"sourceHtmlUrl":150},"references\u002Foption-target.md",3681,"https:\u002F\u002Fgithub.com\u002Fpi-ohm\u002Fpi-ohm\u002Fblob\u002Fdev\u002F.agents\u002Fskills\u002Ftsdown\u002Freferences\u002Foption-target.md",{"path":152,"resourceType":51,"resourceTypeDesc":52,"sizeBytes":153,"sourceHtmlUrl":154},"references\u002Foption-tree-shaking.md",5182,"https:\u002F\u002Fgithub.com\u002Fpi-ohm\u002Fpi-ohm\u002Fblob\u002Fdev\u002F.agents\u002Fskills\u002Ftsdown\u002Freferences\u002Foption-tree-shaking.md",{"path":156,"resourceType":51,"resourceTypeDesc":52,"sizeBytes":157,"sourceHtmlUrl":158},"references\u002Foption-unbundle.md",5701,"https:\u002F\u002Fgithub.com\u002Fpi-ohm\u002Fpi-ohm\u002Fblob\u002Fdev\u002F.agents\u002Fskills\u002Ftsdown\u002Freferences\u002Foption-unbundle.md",{"path":160,"resourceType":51,"resourceTypeDesc":52,"sizeBytes":161,"sourceHtmlUrl":162},"references\u002Foption-watch-mode.md",4635,"https:\u002F\u002Fgithub.com\u002Fpi-ohm\u002Fpi-ohm\u002Fblob\u002Fdev\u002F.agents\u002Fskills\u002Ftsdown\u002Freferences\u002Foption-watch-mode.md",{"path":164,"resourceType":51,"resourceTypeDesc":52,"sizeBytes":165,"sourceHtmlUrl":166},"references\u002FREADME.md",4711,"https:\u002F\u002Fgithub.com\u002Fpi-ohm\u002Fpi-ohm\u002Fblob\u002Fdev\u002F.agents\u002Fskills\u002Ftsdown\u002Freferences\u002FREADME.md",{"path":168,"resourceType":51,"resourceTypeDesc":52,"sizeBytes":169,"sourceHtmlUrl":170},"references\u002Frecipe-react.md",6077,"https:\u002F\u002Fgithub.com\u002Fpi-ohm\u002Fpi-ohm\u002Fblob\u002Fdev\u002F.agents\u002Fskills\u002Ftsdown\u002Freferences\u002Frecipe-react.md",{"path":172,"resourceType":51,"resourceTypeDesc":52,"sizeBytes":173,"sourceHtmlUrl":174},"references\u002Frecipe-vue.md",6572,"https:\u002F\u002Fgithub.com\u002Fpi-ohm\u002Fpi-ohm\u002Fblob\u002Fdev\u002F.agents\u002Fskills\u002Ftsdown\u002Freferences\u002Frecipe-vue.md",{"path":176,"resourceType":51,"resourceTypeDesc":52,"sizeBytes":177,"sourceHtmlUrl":178},"references\u002Frecipe-wasm.md",3021,"https:\u002F\u002Fgithub.com\u002Fpi-ohm\u002Fpi-ohm\u002Fblob\u002Fdev\u002F.agents\u002Fskills\u002Ftsdown\u002Freferences\u002Frecipe-wasm.md",{"path":180,"resourceType":51,"resourceTypeDesc":52,"sizeBytes":181,"sourceHtmlUrl":182},"references\u002Freference-cli.md",6014,"https:\u002F\u002Fgithub.com\u002Fpi-ohm\u002Fpi-ohm\u002Fblob\u002Fdev\u002F.agents\u002Fskills\u002Ftsdown\u002Freferences\u002Freference-cli.md",[184,208,219,235,247,256],{"skillNo":185,"name":186,"nameZh":6,"description":187,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":188,"categories":189,"keywords":190,"publishedAt":23},"01M6CNV1BTR42BQ76RDEWJA7EC","tuistory","Playwright for terminal apps. Like tmux but designed for agents — virtual terminals you can type into, press keys, wait for text, take snapshots, and screenshot as images. tuistory has **2 modes**:\n\n- **CLI** (`tuistory` command) — shell-based. Launch sessions, type, press keys, snapshot, screenshot.\n  Runs a background daemon that persists sessions across commands. Install globally or use `npx`\u002F`bunx`.\n  **You MUST run `tuistory --help` before using the CLI** to see the latest commands and options.\n- **JS\u002FTS API** (`import { launchTerminal } from 'tuistory'`) — programmatic. Use in vitest\u002Fbun:test to write Playwright-style tests for CLIs and TUIs with inline snapshots.\n\nUse tuistory when you need to:\n- Write e2e tests for CLI\u002FTUI apps (vitest, bun:test) with inline snapshots\n- Automate terminal interactions (launch a REPL, debugger, or TUI and drive it)\n- Screenshot terminal as images to send to users (Discord bots, agent UIs like kimaki\u002Fopenclaw)\n- Reproduce bugs in interactive CLIs by scripting the exact steps\n- Explore TUI apps progressively with observe-act-observe loops","https:\u002F\u002Fgithub.com\u002Fpi-ohm\u002Fpi-ohm\u002Fblob\u002Fdev\u002F.pi\u002Fskills\u002Ftuistory\u002FSKILL.md",[],[186,191,192,193,194,195,196,197,198,199,200,201,202,203,22,204,205,206,38,207],"cli","discord","playwright","test","sessions","e2e","api","vitest","explore","wait for","text","virtual","interactive","snapshots","observe","images","bots",{"skillNo":209,"name":210,"nameZh":6,"description":211,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":212,"categories":213,"keywords":214,"publishedAt":23},"01M6CNTYZBGHNGECR0M0YE4YJN","better-result","Adopt better-result in an existing TypeScript codebase. Use when replacing try\u002Fcatch, Promise rejection handling, null sentinels, or thrown domain exceptions with typed Result workflows.","https:\u002F\u002Fgithub.com\u002Fpi-ohm\u002Fpi-ohm\u002Fblob\u002Fdev\u002F.pi\u002Fskills\u002Fbetter-result\u002FSKILL.md",[],[215,216,217,22,218,18],"better result","promise","references","workflows",{"skillNo":220,"name":221,"nameZh":6,"description":222,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":223,"categories":224,"keywords":225,"publishedAt":23},"01M6CNTRH6X4AXAJXEN1XRFXDW","improve-codebase-architecture","Scan a codebase for deepening opportunities, present them as a visual HTML report, then grill through whichever one you pick.","https:\u002F\u002Fgithub.com\u002Fpi-ohm\u002Fpi-ohm\u002Fblob\u002Fdev\u002F.agents\u002Fskills\u002Fimprove-codebase-architecture\u002FSKILL.md",[],[226,227,228,229,230,231,232,233,234],"improve codebase architecture","architecture","improve","html","report","html report","pick","grill","scan",{"skillNo":236,"name":237,"nameZh":6,"description":238,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":239,"categories":240,"keywords":241,"publishedAt":23},"01M6CNTPT5C2HH0TTD5TATM08B","grilling","Interview the user relentlessly about a plan or design. Use when the user wants to stress-test a plan before building, or uses any 'grill' trigger phrases.","https:\u002F\u002Fgithub.com\u002Fpi-ohm\u002Fpi-ohm\u002Fblob\u002Fdev\u002F.agents\u002Fskills\u002Fgrilling\u002FSKILL.md",[],[237,242,243,194,244,245,246,22,233],"plan","design","before building","user","interview",{"skillNo":248,"name":249,"nameZh":6,"description":250,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":251,"categories":252,"keywords":253,"publishedAt":23},"01M6CNTNC91VSQZZ9950TKAV2C","grill-me","A relentless interview to sharpen a plan or design.","https:\u002F\u002Fgithub.com\u002Fpi-ohm\u002Fpi-ohm\u002Fblob\u002Fdev\u002F.agents\u002Fskills\u002Fgrill-me\u002FSKILL.md",[],[233,254,243,242,255,246],"grill me","sharpen",{"skillNo":257,"name":258,"nameZh":6,"description":259,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":260,"categories":261,"keywords":262,"publishedAt":23},"01M6CNTKD0SFT7F2HVWT20Q2ZX","design-an-interface","Generate multiple radically different interface designs for a module using parallel sub-agents. Use when user wants to design an API, explore interface options, compare module shapes, or mentions \"design it twice\".","https:\u002F\u002Fgithub.com\u002Fpi-ohm\u002Fpi-ohm\u002Fblob\u002Fdev\u002F.agents\u002Fskills\u002Fdesign-an-interface\u002FSKILL.md",[],[243,263,264,197,199,265,245,22],"design an interface","generate","parallel"]