While using dts in tsup, there seems to be that all built declaration files are bundled into one file.
What I am expecting that the generated dts structure follows the source structures.
For example, if my source structure looks like this,
And the src/index.ts file exports all of them like this
export {
Badge,
Button,
} from './components
My expectation of dts is creating separted d.ts files like this.
However, by applying the dts of tsup, it creates only a single of .d.ts file not following above source structure. What I knew that vite-plugin-dts is following the source structure like above example.
Is there any way to follow source structure of dts in tsup?
Or Is this single d.ts creation behavior intended for specific reason?
My tsup config that creates a single d.ts is as follows.
I think this is intended behavior, otherwise, what would be the difference between what you expect and just running tsc --declaration --emitDeclarationOnly?
While using dts in tsup, there seems to be that all built declaration files are bundled into one file. What I am expecting that the generated dts structure follows the source structures.
For example, if my source structure looks like this,
And the
src/index.ts
file exports all of them like thisMy expectation of dts is creating separted
d.ts
files like this.However, by applying the dts of tsup, it creates only a single of
.d.ts
file not following above source structure. What I knew that vite-plugin-dts is following the source structure like above example.Is there any way to follow source structure of
dts
intsup
? Or Is this singled.ts
creation behavior intended for specific reason?My tsup config that creates a single
d.ts
is as follows.Upvote & Fund