rollup-plugin-dts icon indicating copy to clipboard operation
rollup-plugin-dts copied to clipboard

Valid packages without `types` declaration in `package.json` seem to be ignored

Open moltar opened this issue 1 year ago • 0 comments

Checklist

  • [ ] I can reproduce this issue when running this plugin on its own.
  • [x] I am running this plugin on .d.ts files generated by TypeScript.
  • [x] This issue is not related to rolling up @types.

I can reproduce this issue when running this plugin on its own.

I did not attempt this, as I believe tsup is not doing anything unusual with rollup-plugin-dts, and mostly just passing config options as-is. But if you want me to try it with raw rollup config, I can.

Please refer to this issue for all of the details and investigation: https://github.com/egoist/tsup/issues/1007

In summary:

A package.json that has no types property declared, will not result in bundling, even when the package is valid and is passing ATTW (Are the Types Wrong) test.

https://www.npmjs.com/package/@changesets/types?activeTab=code

screenshot-20230921T105725-YNfGyaAr@2x
screenshot-20230921T105740-iM14pRpY@2x

Code Snipped

Full repro with code: https://github.com/moltar/tsup-dts-resolve#readme

Error Message

No error message.

But the types are failing to bundle.

moltar avatar Sep 21 '23 09:09 moltar