A TypeScript Rollup plugin that bundles declarations, respects Browserslists, and enables seamless integration with transpilers such as babel and swc
496
stars
33
forks
source link
Types missing due to reference directive bundling #221
Open
kevinkucharczyk opened 1 year ago
tsc
(if applicable):Reproduction
I have a React component, where I import some React types as:
tsconfig.json is
rollup config is:
Expected Behavior
The bundled index.d.ts file should contain the correct types when referencing 3rd party libraries. It should either be:
Or provide an option to skip the reference types declaration entirely, and have the .d.ts output be
Actual Behavior
When I run
rollup-plugin-ts
, theindex.d.ts
output contains:ReactNode
isn't referenced anywhere, and using this component in another repo gives meany
types for any props that use React types.I can use
but I'd prefer not having to import things this way.