developit / microbundle

📦 Zero-configuration bundler for tiny modules.
https://npm.im/microbundle
MIT License
8.06k stars 361 forks source link

Built package loses type definitions upon import. #844

Closed KwehDev closed 4 months ago

KwehDev commented 3 years ago

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 :)

rschristian commented 3 years ago

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.

KwehDev commented 3 years ago

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

rschristian commented 3 years ago

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

KwehDev commented 3 years ago

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

rschristian commented 4 months ago

Closing as no reproduction provided.