Support moduleResolution: 'node16'
+ for package.json
exports
#437
Labels
kind: feature
New feature or request
priority: in progress
solution: needs test
This issue requires creating a test to assuredly close out
topic: TS version
Related to a change in a TS version
Troubleshooting
Does
tsc
have the same output? If so, please explain why this is incorrect behaviortsc
uses actual moduleResolution from my tsconfig so it works.Does your Rollup plugin order match this plugin's compatibility? If not, please elaborate
I'm using tsdx, which uses this plugin internally, so not really sure about this.
Can you create a minimal example that reproduces this behavior? Preferably, use this environment for your reproduction
I can do that if needed. But this issue is very easily reproducable.
What happens and why it is incorrect
I want to import something from a package that uses package.json exports. Here, ethers is a package, and address is defined as an export in it's package.json.
The above compiles successfully with vanilla typescript compiler, when moduleResolution is set to node16. With rollup-plugin-typescript2, the moduleResolution is overridden and hence typescript compiler gives the exact error as if moduleResolution is set to
node
:The
moduleResolution
from user's tsconfig is overridden is set to legacy node resolution (relevant code). I think this is incorrect because typescript wants moduleResolution to benode16
ornodenext
if a dev wants to use package json exports.Environment
Versions
:rollup.config.js
:tsconfig.json
:package.json
plugin output with verbosity 3
:The text was updated successfully, but these errors were encountered: