microbundle icon indicating copy to clipboard operation
microbundle copied to clipboard

Built package loses type definitions upon import.

Open KwehDev opened this issue 3 years ago • 4 comments

package.json:

  "main": "dist/index.umd.js",
  "module": "dist/index.modern.module.js",
  "types": "dist/index.d.ts",

Upon importing this package in another package, our build only includes certain types, for others they are 'any'.

Our .dist folder includes hooks.d.ts, store.d.ts, & index.d.ts.

I understand this is not much info, I am unfamiliar with the microbundle package, so if you need any more info, please ask :)

KwehDev avatar May 28 '21 18:05 KwehDev

Does index.d.ts not import / use hooks.d.ts or store.d.ts? That's usually how the full types are consumed.

Yes, could use a reproduction here as this is little information to go on.

rschristian avatar May 28 '21 18:05 rschristian

index.d.ts does indeed import hooks.d.ts & store.d.ts. I will throw a reproduction together.

KwehDev avatar May 28 '21 18:05 KwehDev

Types should just work then. Might be an issue with your editor?

rschristian avatar May 28 '21 18:05 rschristian

I don't think so, my entire team has the issue. The types work as expected when importing the package directly, without building.

KwehDev avatar May 28 '21 18:05 KwehDev