# rollup-plugin-typescript2

> Rollup plugin that compiles TypeScript and reports its type errors

Source: https://talira.ai/catalog/rollup-plugin-typescript2-17wx7w1d
Every listing: https://talira.ai/catalog.md

- Kind: Open source
- Types: Plugin
- Categories: [developer tools / build / bundlers](https://talira.ai/categories/developer-tools/build/bundlers), [languages / typescript](https://talira.ai/categories/languages/typescript)
- Licence: MIT[^2]
- Pricing: Free and open source[^2]
- Free tier: yes[^2]
- Backed by: [Eugene Zolenko](https://talira.ai/orgs/eugene-zolenko.md)

rollup-plugin-typescript2 is a [Rollup](https://talira.ai/catalog/rollup-3a0frcmv.md) plugin that compiles TypeScript with the TypeScript compiler itself and prints its syntactic and semantic diagnostics during the build, which the original rollup-plugin-typescript didn't. It's a rewrite of that plugin, a little slower, and takes its compiler options and file list from tsconfig.json, with options to point at another tsconfig or override settings. It writes declaration files and declaration maps, keeps a cache between builds, and can run beside a transpiling plugin such as Babel, esbuild or SWC to do only type-checking and declarations.

## Links

- GitHub: https://github.com/ezolenko/rollup-plugin-typescript2

## Problems it solves

- see TypeScript type errors when I bundle my library with Rollup
- build a TypeScript library with Rollup and get .d.ts declaration files
- my Rollup TypeScript build passes even though the code has type errors

## Features

- Prints TypeScript's syntactic and semantic errors during a Rollup build
- Uses the compiler options and files from tsconfig.json, with overrides
- Emits declaration files and declaration maps
- Caches compilation between builds
- Can type-check and emit declarations while another plugin transpiles
- Works in Rollup's watch mode

## Limitations

- Slower than the original rollup-plugin-typescript, since it runs the full type checker[^1]
- Changes to type-only imports and ambient types don't trigger a rebuild in watch mode[^1]

## Trust

Overall: 0.34 out of 1.
Signals: maintenance 0.27, adoption 0.58, momentum 0.27, community 0.61, backing 0.30, extensibility 0.00.

- 823 GitHub stars
- 33 contributors
- backed by Eugene Zolenko

Warnings:

- last commit 4 months ago

## Related

- Works with [Rollup](https://talira.ai/catalog/rollup-3a0frcmv.md)
- Works with [TypeScript](https://talira.ai/catalog/typescript-w0asrgz8.md)

## Alternatives

- [rollup-plugin-dts](https://talira.ai/catalog/rollup-plugin-dts-nkp9e6vz.md): Bundle TypeScript .d.ts declaration files with Rollup
- [tsdown](https://talira.ai/catalog/tsdown-8gyzrn37.md): Library bundler for TypeScript and JavaScript, built on Rolldown
- [unplugin-dts](https://talira.ai/catalog/unplugin-dts-sf05s9zj.md): Generate .d.ts declaration files from TypeScript or Vue sources in your bundler
- [tsup](https://talira.ai/catalog/tsup-evezd0pk.md): Zero-config bundler for TypeScript libraries, powered by esbuild
- [Rollup](https://talira.ai/catalog/rollup-3a0frcmv.md): ES module bundler for JavaScript libraries and apps, with tree shaking
- [ts-loader](https://talira.ai/catalog/ts-loader-h2hq220a.md): The TypeScript loader for webpack: compile .ts and .tsx files as part of a webpack build

## Sources

[^1]: https://github.com/ezolenko/rollup-plugin-typescript2/blob/master/README.md (checked 28 Nov 2026)
[^2]: https://github.com/ezolenko/rollup-plugin-typescript2/blob/master/LICENSE (checked 28 Nov 2026)
