feat(typescript): align with --moduleResolution=bundler#22887
feat(typescript): align with --moduleResolution=bundler#22887dgozman merged 1 commit intomicrosoft:mainfrom
--moduleResolution=bundler#22887Conversation
| if (!resolved.endsWith(ext)) | ||
| continue; | ||
| for (const other of others) { | ||
| const modified = resolved.substring(0, resolved.length - ext.length) + other; |
There was a problem hiding this comment.
Looks like you could move it outside of the loop: resolved.substring(0, resolved.length - ext.length)
This relaxes import requirements and allows importing `.ts` files without an extenstion in CJS and ESM modes.
|
Is there any comment on when this will be released? |
|
@kristojorg Should be already available in v1.34. |
|
Ah I see it is, didn't see it in the changelog but it's working. I am wondering, however, if directory imports are meant to be supported by this as well? Outside Playwright in my ESModules app I can import directories |
|
It does look like TS intends to enable the directory imports according to the |
|
@kristojorg Yeah, it does not work with directory importing, good point! Could you please file a new issue? We'll address it for the next release. |
This updates previous work in microsoft#22887 to align more fully with `--moduleResolution=bundler`, allowing index files to be imported with the /index extension
|
I went ahead and added a PR: #23254 |
This updates previous work in microsoft#22887 to align more fully with `--moduleResolution=bundler`, allowing index files to be imported with the /index extension
This updates previous work in #22887 to align more fully with `--moduleResolution=bundler`, allowing index files to be imported with the /index extension --------- Signed-off-by: Kristo Jorgenson <kristojorg@users.noreply.github.com> Co-authored-by: Dmitry Gozman <dgozman@gmail.com>
This relaxes import requirements and allows importing
.tsfiles without an extension in CJS and ESM modes.Fixes #22169.