{"id":50954580,"url":"https://github.com/benhatsor/rollup-dts-bundler","last_synced_at":"2026-06-18T05:01:38.295Z","repository":{"id":355080431,"uuid":"1212514738","full_name":"benhatsor/rollup-dts-bundler","owner":"benhatsor","description":"Rollup plugin for bundling .d.ts declarations via @microsoft/api-extractor.","archived":false,"fork":false,"pushed_at":"2026-05-01T18:30:45.000Z","size":206,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-05-01T20:13:32.549Z","etag":null,"topics":["rolldown","rollup","typescript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/benhatsor.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-04-16T13:04:51.000Z","updated_at":"2026-05-01T18:30:49.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/benhatsor/rollup-dts-bundler","commit_stats":null,"previous_names":["benhatsor/rollup-dts-bundler"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/benhatsor/rollup-dts-bundler","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benhatsor%2Frollup-dts-bundler","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benhatsor%2Frollup-dts-bundler/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benhatsor%2Frollup-dts-bundler/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benhatsor%2Frollup-dts-bundler/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/benhatsor","download_url":"https://codeload.github.com/benhatsor/rollup-dts-bundler/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benhatsor%2Frollup-dts-bundler/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34476728,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-18T02:00:06.871Z","response_time":128,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["rolldown","rollup","typescript"],"created_at":"2026-06-18T05:01:35.634Z","updated_at":"2026-06-18T05:01:38.284Z","avatar_url":"https://github.com/benhatsor.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# rollup-dts-bundler\n\n[![npm version][npm-version-src]][npm-version-href]\n[![CI][ci-src]][ci-href]\n[![Coverage Status][coverage-src]][coverage-href]\n\nRollup plugin for accurate `.d.ts` bundling via [@microsoft/api-extractor].\n\n## Why?\n[@microsoft/api-extractor] is Microsoft's official `.d.ts` bundler. Unlike common alternatives ([rollup-plugin-dts], [rolldown-plugin-dts], [dts-bundle-generator]), it doesn't mangle type names or drop re-exports. Problem is, it was designed as a monolithic CLI with verbose config files. This plugin exposes it as a simple Rollup interface.\n\n## Usage\n\nInstall the package from `npm`:\n```sh\nnpm install --save-dev rollup-dts-bundler\n```\n\nAdd it to your `rollup.config.js`:\n```js\nimport { dts } from 'rollup-dts-bundler'\n\nexport default [\n  // …\n  {\n    input: 'src/index.ts',\n    output: { file: 'dist/index.d.ts', format: 'es' },\n    plugins: [dts()],\n  }\n]\n```\n\nThen point your `package.json` at the output:\n```json\n  \"types\": \"dist/index.d.ts\",\n```\n\n\u003e External libraries (e.g. `@types/*`) are automatically excluded from bundling.\n\n## Options\n```ts\ndts({\n  // Path to tsconfig.json (relative to cwd or absolute).\n  // When omitted, walks up from the entry's directory to find the nearest tsconfig.\n  tsconfig: 'tsconfig.build.json',\n\n  // npm package names whose declarations should be inlined into the output\n  // instead of left as external imports. Useful for re-exporting types from\n  // an internal workspace package.\n  bundledPackages: ['@my-scope/internal-types'],\n})\n```\n\n## How it works\nThe entry point is stubbed out so Rollup only provides the input/output config. All real work happens in the `generateBundle` hook: declarations are emitted via tsc, fed to api-extractor, and the result is output as an asset.\n\n## Releases\nReleases publish to npm with OIDC provenance after the test suite passes at 100% coverage. Renovate dependency updates on `main` release automatically; `npm run release` cuts a manual release. See [RELEASING.md](/RELEASING.md) for details.\n\n## License\n[MIT](/LICENSE)\n\n\n\u003c!-- References --\u003e\n[@microsoft/api-extractor]: https://github.com/microsoft/rushstack/tree/main/apps/api-extractor\n[rollup-plugin-dts]: https://github.com/Swatinem/rollup-plugin-dts\n[rolldown-plugin-dts]: https://github.com/sxzz/rolldown-plugin-dts\n[dts-bundle-generator]: https://github.com/timocov/dts-bundle-generator\n\n\u003c!-- Badges --\u003e\n[npm-version-src]: https://img.shields.io/npm/v/rollup-dts-bundler.svg\n[npm-version-href]: https://npmjs.com/package/rollup-dts-bundler\n[ci-src]: https://github.com/benhatsor/rollup-dts-bundler/actions/workflows/ci.yml/badge.svg\n[ci-href]: https://github.com/benhatsor/rollup-dts-bundler/actions/workflows/ci.yml\n[coverage-src]: https://coveralls.io/repos/github/benhatsor/rollup-dts-bundler/badge.svg?branch=main\n[coverage-href]: https://coveralls.io/github/benhatsor/rollup-dts-bundler?branch=main\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbenhatsor%2Frollup-dts-bundler","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbenhatsor%2Frollup-dts-bundler","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbenhatsor%2Frollup-dts-bundler/lists"}