TypeStrong / dts-bundle

Export TypeScript .d.ts files as an external module definition
MIT License
308 stars 57 forks source link

Bundle includes more than it should when using main #63

Open JonWallsten opened 6 years ago

JonWallsten commented 6 years ago

I'm using the latest dts-bundle to combine the d.ts files generated by typescript compiler. When setting main to my index.d.ts file I expect the output in the bundle to match what's actually exported in my index.ts file. It seems however that it treats all exports as a wildcard. So this: export { destruct } from 'module' in practice becomes this export * from 'modules'

Which is unfortunately really bad since my IDE now thinks certain things are exported, based on the d.ts file, when they are not, which leads to false positives in the type checker. And you wont notice until you get weird runtime errors. I don't know if this is intended or a limitation/bug.