Closed IgnusG closed 1 year ago
Is this going anywhere?
Can you copy over the test from https://github.com/dividab/tsconfig-paths/pull/213 ?
I would also like to know if this handles .mjs
files, which is what is emitted by the TS compiler when files are .mts
files.
I would also like to know if this handles
.mjs
files, which is what is emitted by the TS compiler when files are.mts
files.
Good catch. There should definitely be a test for that.
I'll add both tests and check the mjs support 👍
I would also like to know if this handles
.mjs
files, which is what is emitted by the TS compiler when files are.mts
files.
@WoodyWoodsta can you please check if https://github.com/dividab/tsconfig-paths/pull/216/commits/39354fbbb6c819caf53ff1459510b4c6ca1cf699 works for you? I barely remember this PR so I just quickly wrote down a test for it
@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! This is great work and an important step in moving to full esm.
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 https://github.com/dividab/tsconfig-paths/pull/213 (edit 1: wrong issue sorry, edit 2: actually I believe this might resolve that issue as well) & https://github.com/aleclarson/vite-tsconfig-paths/issues/59