Skip to content

Allow program to be passed into generateDtsBundle #350

@Danielku15

Description

@Danielku15

Currently dts-bundle-generator always creates a new TypeScript compilation using the provided compiler options.

https://github.com/timocov/dts-bundle-generator/blob/964f6c62d9f825d222661c179adc47fb7f23c6ac/src/bundle-generator.ts#L142C17-L146

I'd like to pass a custom ts.Program into generateDtsBundle

Use Case:

I want to create bundled DTS files inside a Rollup/Vite plugin. There I already have access to the ts.Program which is used to generally compile and bundle my library.

I create multiple d.ts for different entry points and this is currently very expensive. Reusing the existing program would help a lot speeding up the compilation.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions