[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M75BMVAJR8RTXN16TP7PSZ30":3,"skill-same:01M75BMVAJR8RTXN16TP7PSZ30":45},{"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":18,"linkOnly":19,"markdownContent":20,"markdownBody":21,"frontMatter":22,"refName":23,"commitSha":24,"skillDirectory":25,"forksCount":26,"repositoryHtmlUrl":27,"repositoryHomepageUrl":28,"ownerHtmlUrl":29,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":30,"install":31,"resources":44},"01M75BMVAJR8RTXN16TP7PSZ30","tsdown",null,"Blazing-fast bundler for TypeScript\u002FJavaScript libraries powered by Rolldown and Oxc.","ruake\u002FAWARE","ruake","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F253885939?v=4","01M75AVBM7FRFTS61RZRNMZB6C","01M75AVBMYHD7500NHVANF1HKM",0,"MIT","https:\u002F\u002Fgithub.com\u002Fruake\u002FAWARE\u002Fblob\u002Fmain\u002F.opencode\u002Fskills\u002Ftsdown\u002FSKILL.md",[],[],"2026-11-12 13:55:43",false,"---\nname: tsdown\ndescription: Blazing-fast bundler for TypeScript\u002FJavaScript libraries powered by Rolldown and Oxc.\n---\n\n# tsdown - The Elegant Library Bundler\n\nBlazing-fast bundler for TypeScript\u002FJavaScript libraries powered by Rolldown and Oxc.\n\n## Runtime Requirement\n\n`tsdown` requires **Node.js 22.18.0 or higher to run** (build-time only). However, the bundled output can target much lower Node.js versions via the [`target`](references\u002Foption-target.md) option, so libraries built with tsdown are **not locked to Node.js 22+ at runtime**.\n\nIf your package needs to support Node.js 18 \u002F 20:\n\n- **Build with Node.js 22+ in CI** (e.g. set `target: 'node18'` or `target: 'node20'`).\n- **Test the built output (or the packed tarball) on the lower Node.js versions** you intend to support — e.g. using a matrix job that runs the published package's tests on Node.js 18 \u002F 20 \u002F 22.\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\n> For comprehensive migration assistance with complete option mappings, install the dedicated [`tsdown-migrate`](..\u002Ftsdown-migrate\u002FSKILL.md) skill: `npx skills add rolldown\u002Ftsdown --skill tsdown-migrate`\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 dependency\u002Fpeer\u002Foptional 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` - Generate exports field | [option-package-exports](references\u002Foption-package-exports.md) |\n| CSS handling | **[experimental]** `css: { ... }` — full pipeline with preprocessors, Lightning CSS, PostCSS, CSS modules, code splitting; requires `@tsdown\u002Fcss` | [option-css](references\u002Foption-css.md) |\n| CSS modules | `css: { modules: { localsConvention: 'camelCase' } }` — scoped class names for `.module.css` files | [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","# tsdown - The Elegant Library Bundler\n\nBlazing-fast bundler for TypeScript\u002FJavaScript libraries powered by Rolldown and Oxc.\n\n## Runtime Requirement\n\n`tsdown` requires **Node.js 22.18.0 or higher to run** (build-time only). However, the bundled output can target much lower Node.js versions via the [`target`](references\u002Foption-target.md) option, so libraries built with tsdown are **not locked to Node.js 22+ at runtime**.\n\nIf your package needs to support Node.js 18 \u002F 20:\n\n- **Build with Node.js 22+ in CI** (e.g. set `target: 'node18'` or `target: 'node20'`).\n- **Test the built output (or the packed tarball) on the lower Node.js versions** you intend to support — e.g. using a matrix job that runs the published package's tests on Node.js 18 \u002F 20 \u002F 22.\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\n> For comprehensive migration assistance with complete option mappings, install the dedicated [`tsdown-migrate`](..\u002Ftsdown-migrate\u002FSKILL.md) skill: `npx skills add rolldown\u002Ftsdown --skill tsdown-migrate`\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 dependency\u002Fpeer\u002Foptional 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` - Generate exports field | [option-package-exports](references\u002Foption-package-exports.md) |\n| CSS handling | **[experimental]** `css: { ... }` — full pipeline with preprocessors, Lightning CSS, PostCSS, CSS modules, code splitting; requires `@tsdown\u002Fcss` | [option-css](references\u002Foption-css.md) |\n| CSS modules | `css: { modules: { localsConvention: 'camelCase' } }` — scoped class names for `.module.css` files | [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",{"name":5,"description":7},"main","6184979e01f673905139589c194eab38198db2f7",".opencode\u002Fskills\u002Ftsdown",1,"https:\u002F\u002Fgithub.com\u002Fruake\u002FAWARE","https:\u002F\u002Fruake.github.io\u002FAWARE","https:\u002F\u002Fgithub.com\u002Fruake","2026-11-15 04:27:27",{"source":8,"skillName":5,"commands":32,"prompt":42,"zipAvailable":43},[33,36,39],{"tool":34,"command":35},"npx","npx skills add ruake\u002FAWARE --skill tsdown",{"tool":37,"command":38},"bunx","bunx skills add ruake\u002FAWARE --skill tsdown",{"tool":40,"command":41},"pnpm","pnpm dlx skills add ruake\u002FAWARE --skill tsdown","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fruake\u002FAWARE\u002Fblob\u002Fmain\u002F.opencode\u002Fskills\u002Ftsdown\u002FSKILL.md",true,[],[46,52,59,66,73,79],{"skillNo":47,"name":48,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":49,"categories":50,"keywords":51,"publishedAt":18},"01M75BPBYT89TEE87CGBDX2KF5","xlsx","https:\u002F\u002Fgithub.com\u002Fruake\u002FAWARE\u002Fblob\u002Fmain\u002F.opencode\u002Fskills\u002Fxlsx\u002FSKILL.md",[],[],{"skillNo":53,"name":54,"nameZh":6,"description":55,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":56,"categories":57,"keywords":58,"publishedAt":18},"01M75BPA000S9MTH5MY7CZNYYQ","writing-plans","Write comprehensive implementation plans assuming the engineer has zero context for our codebase and questionable taste.","https:\u002F\u002Fgithub.com\u002Fruake\u002FAWARE\u002Fblob\u002Fmain\u002F.opencode\u002Fskills\u002Fwriting-plans\u002FSKILL.md",[],[],{"skillNo":60,"name":61,"nameZh":6,"description":62,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":63,"categories":64,"keywords":65,"publishedAt":18},"01M75BP80ETH9GYVRH8A7QPCSG","web-design-guidelines","Review files for compliance with Web Interface Guidelines.","https:\u002F\u002Fgithub.com\u002Fruake\u002FAWARE\u002Fblob\u002Fmain\u002F.opencode\u002Fskills\u002Fweb-design-guidelines\u002FSKILL.md",[],[],{"skillNo":67,"name":68,"nameZh":6,"description":69,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":70,"categories":71,"keywords":72,"publishedAt":18},"01M75BP5XG8SX5Q2WWZB6QRVFT","web-component-design","Build reusable, maintainable UI components using modern frameworks with clean composition patterns and styling approache","https:\u002F\u002Fgithub.com\u002Fruake\u002FAWARE\u002Fblob\u002Fmain\u002F.opencode\u002Fskills\u002Fweb-component-design\u002FSKILL.md",[],[],{"skillNo":74,"name":75,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":76,"categories":77,"keywords":78,"publishedAt":18},"01M75BP4B1FC4V81QR1VB56H1E","web-artifacts-builder","https:\u002F\u002Fgithub.com\u002Fruake\u002FAWARE\u002Fblob\u002Fmain\u002F.opencode\u002Fskills\u002Fweb-artifacts-builder\u002FSKILL.md",[],[],{"skillNo":80,"name":81,"nameZh":6,"description":82,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":83,"categories":84,"keywords":85,"publishedAt":18},"01M75BP1XVRW8WQ2XXAJBAYV2V","vueuse-functions","This skill is a decision-and-implementation guide for VueUse composables in Vue.js \u002F Nuxt projects. It maps requirements","https:\u002F\u002Fgithub.com\u002Fruake\u002FAWARE\u002Fblob\u002Fmain\u002F.opencode\u002Fskills\u002Fvueuse-functions\u002FSKILL.md",[],[]]