
Company News
Jerod Santo Joins Socket as Head of Media
Allow myself to introduce... myself.
@shtse8/bun-plugin-dts
Advanced tools
A Bun plugin to generate TypeScript declaration files (.d.ts) during build.
A plugin for Bun that generates TypeScript declaration files
(.d.ts) during the bun build process.
Bun's built-in bundler (bun build) is incredibly fast, but it currently does
not generate .d.ts files automatically. This makes it difficult to publish
TypeScript libraries built with Bun, as consumers rely on these files for type
checking and autocompletion.
@shtse8/bun-plugin-dts solves this by hooking into the build process and using
the TypeScript Compiler API to generate the necessary declaration files
alongside your JavaScript output.
bun add --dev @shtse8/bun-plugin-dts
You also need typescript installed, which is likely already in your project:
bun add --dev typescript
Import the plugin and add it to the plugins array in your Bun.build
configuration.
Example build.ts:
import Bun from "bun";
import dts from "@shtse8/bun-plugin-dts"; // Import the plugin
await Bun.build({
entrypoints: ["./src/index.ts"],
outdir: "./dist",
target: "bun", // Or your desired target
plugins: [
dts(), // Add the plugin here
],
// ... other build options
});
console.log("Build complete!");
The plugin will automatically:
tsconfig.json in the project root.outdir) from the Bun.build
config..d.ts files corresponding to your entry points within the
specified outdir.Currently, the plugin automatically detects settings from your tsconfig.json
and Bun.build configuration. Explicit plugin options may be added in the
future if needed.
Contributions are welcome! Please feel free to open an issue or submit a pull request on the GitHub repository.
This project is licensed under the MIT License. See the LICENSE file for details.
FAQs
A Bun plugin to generate TypeScript declaration files (.d.ts) during build.
We found that @shtse8/bun-plugin-dts demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.

Company News
Allow myself to introduce... myself.

Research
/Security News
A Twitch browser extension on Chrome and Firefox forwards users’ live OAuth session tokens through proxies controlled by a Russian bot service.

Security News
Anthropic found biased reasoning and recklessness drove Claude Mythos 5 to publish malware on PyPI and compromise a security vendor.