Skip to content

excluded field for genereted d.ts files #212

@denis88k

Description

@denis88k

Clear and concise description of the problem

Generating .d.ts for every entry (e.g. hundreds of icons) is unnecessary and slows the build. tsconfig exclude does not help when those files are still listed as entry points.

Suggested solution

Add a way to skip declaration emit for paths matching globs

import { defineConfig } from 'tsdown'
export default defineConfig({
  entry: ['src/**/*.ts', 'src/Icon/Icons/**/index.js'],
  outDir: 'lib',
  unbundle: true,
  root: 'src',
  dts: {
    tsconfig: 'tsconfig.build.json',
    resolver: 'oxc',
    exclude: ['src/Icon/Icons/**'], // <- this add
  },
})

This would mirror the ergonomics of vite-plugin-dts, which supports include / exclude on the plugin options.

Alternative

Split into two configs: one with dts: { ... }, one with dts: false for the same entries subset.

Additional context

No response

Validations

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions