wessberg / rollup-plugin-ts

A TypeScript Rollup plugin that bundles declarations, respects Browserslists, and enables seamless integration with transpilers such as babel and swc
MIT License
496 stars 32 forks source link

`moduleResolution` is ignored - cannot consume modern packages #214

Closed gossi closed 1 year ago

gossi commented 1 year ago

Starting with typescript v4.7 it can use node16 and nodenext to resolve modules from depending packages. That is it reads the exports field from those packages. With only node as moduleResolution, this exports field is not read and classic resolution is applied.

Now that more and more packages are published with exports field (and drop support for classic/cjs resolving), this needs to be applied. However rollup-plugin-ts ignores moduleResolution and thus is not compatible with modern packages.

Expected Behavior

Expected behavior: Use node16/nodenext as default - or even better make it configurable for needs at hand.

Actual Behavior

Ignores moduleResolution.

wessberg commented 1 year ago

Hi @gossi,

This has been resolved as part of v3.3.0. Specifically, whatever module resolution could be found in the given config is respected.