Swatinem / rollup-plugin-dts

A rollup plugin to generate .d.ts rollup files for your typescript project
GNU Lesser General Public License v3.0
812 stars 70 forks source link

Importing from an `export = namespace` not supported #93

Closed OmgImAlexis closed 1 year ago

OmgImAlexis commented 4 years ago

Seems rollup-plugin-dts doesn't support import from namespace yet?:

Ref: https://github.com/egoist/tsup/issues/14#issuecomment-630220268

Swatinem commented 4 years ago

Copy-pasting from https://github.com/egoist/tsup/issues/14#issuecomment-630227883:

Sometimes the things from @types have really strange idioms in them, and its a nightmare to work with.

This example in particular. I think, this is whats going on:

trusktr commented 4 years ago

I agree, let's support the ES Module future and not dwell on CommonJS pitfalls.

IanVS commented 2 years ago

Hi, is this still an issue? I'm hitting problems when using tsup because of various sub-dependencies using export = in their .d.ts files, and I'm unsure what's needed to solve it.

Swatinem commented 2 years ago

This is still not supported, and I doubt I will add support for this myself. PRs welcome of course.

The question here would rather be: Why are you trying to bundle your sub-dependencies in the first place?

IanVS commented 2 years ago

I don't think I am. But I'm not sure. I'm trying to add a feature into Storybook, which has recently started using tsup. Importing types from fastify is breaking the build, apparently because of this issue. What configuration would I need to look for to see whether or not sub-dependencies are being bundled? I've not worked with tsup before, and I don't have a great grasp of how it's all working right now.

Swatinem commented 2 years ago

I've not worked with tsup before, and I don't have a great grasp of how it's all working

Neither have I 🤷🏻‍♂️

My plugin ignores external dependencies by default.

Nick-Hopps commented 1 year ago

Is it possible to make the output d.ts file using export = format to support both ESM and CJS?