bun-plugin-dts
A Bun plugin for generating .d.ts
files.
Install
bun add -d bun-plugin-dts
Usage
import dts from 'bun-plugin-dts'
await Bun.build({
entrypoints: ['./src/index.ts', './src/other.ts'],
outdir: './dist',
plugins: [
dts()
],
})
Options
This plugin utilizes dts-bundle-generator internally, allowing you to easily customize its behavior by passing specific options for dts-bundle-generator.
type Options = {
libraries?: LibrariesOptions;
failOnClass?: boolean;
output?: OutputOptions;
compilationOptions?: CompilationOptions;
}
interface LibrariesOptions {
inlinedLibraries?: string[];
importedLibraries?: string[];
allowedTypesLibraries?: string[];
}
interface OutputOptions {
sortNodes?: boolean;
umdModuleName?: string;
inlineDeclareGlobals?: boolean;
inlineDeclareExternals?: boolean;
noBanner?: boolean;
respectPreserveConstEnum?: boolean;
exportReferencedTypes?: boolean;
}
interface CompilationOptions {
followSymlinks?: boolean;
preferredConfigPath?: string;
}
License
MIT