-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
feat(typescript): align with --moduleResolution=bundler
#22887
Conversation
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
.ts
files without an extension in CJS and ESM modes.Fixes #22169.