Saitama
Saitama

Reputation: 131

Best way to Bundle Typescript Declaration files to one file

Is there a way to bundle declaration file properly? Not by declaring module approach.

declare module "path/to/file" {
    ...
}

declare module "path/to/file/sub/file" {
    ...
}

etc.

Most stuff I found buggy and sometimes is not working like old dts-bundler which was abandoned 3 years ago etc.

The only working one I found is a rollup plugin https://github.com/Swatinem/rollup-plugin-dts

Upvotes: 6

Views: 856

Answers (1)

Saitama
Saitama

Reputation: 131

@microsoft/api-extractor does the job

Just create folder with declarations. Setup api-extractor config. And you're ready to go

Upvotes: 5

Related Questions