-
Notifications
You must be signed in to change notification settings - Fork 99
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix missing paths when using typescript's module nodenext feature #216
Conversation
This resolution requires relative/mapped import paths to end with .js Reference https://devblogs.microsoft.com/typescript/announcing-typescript-4-5-beta/#esm-nodejs
Is this going anywhere? |
Can you copy over the test from #213 ? |
I would also like to know if this handles |
Good catch. There should definitely be a test for that. |
I'll add both tests and check the mjs support 👍 |
@WoodyWoodsta can you please check if 39354fb works for you? I barely remember this PR so I just quickly wrote down a test for it |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm coming here from aleclarson/vite-tsconfig-paths#54, so I would need to fiddle around to test it - but will do if I manage to find a gap.
@jonaskello could you please take a look through this when you have the time? |
For anyone wanting to use this in the meantime with yarn add this resolution to your package.json {
"resolutions": {
"tsconfig-paths": "github:ignusg/tsconfig-paths@dev"
}
} |
Hey, this pr was thoroughly tests, reviewed, and even approved! Is there a reason why this isn't merged? |
Yes, seems like this change has enough tests so let's merge it. |
This resolution requires relative/mapped import paths to end with .js
This PR detects if a path ends with
.js
and if so adds more extension type paths to try, that omit this extension when attaching additional extensions to match the actual existing files.Reference https://devblogs.microsoft.com/typescript/announcing-typescript-4-5-beta/#esm-nodejs
Should resolve #213 (edit 1: wrong issue sorry, edit 2: actually I believe this might resolve that issue as well) & aleclarson/vite-tsconfig-paths#59