-
-
Notifications
You must be signed in to change notification settings - Fork 39
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
Handling explicit file extension (Node16 + NodeNext) #85
Comments
Interesting. This is one of the things I haven't looked at TSC's implementation. I should note Ezno does not currently read a tsconfig and doesn't have a lot of the same config. The current relative importing logic looks at the path. If the path has an extension then it tries to read it directly. If it does not have an extension it looks for Lines 299 to 312 in 0b5f688
I haven't done a lot of investigation. Let me know if the current thing breaks or doesn't do quite the right thing under certain circumstances. If so maybe porting "module" from TypeScript's configuration might be needed? |
Well imo this could be a good starting point to introduce reading the tsconfig. The module resolution is one use case, but another one would be to handle the aliases as for now it would break everything I think. "paths": {
"@modules/*": ["src/modules/*"],
"@services/*": ["src/services/*"]
} |
Hey! Introducing it only for reading the |
Interesting. I had in plan to use oxc's resolver for files. I think it implements some of tsconfig parsing, so hopefully should have the same features of TSC. For the moment I think adding checking for things like |
Description
Hello again!
When tsconfig has
"module": "node16" | "nodenext"
, all the imports and exports will end with.js
even if it's importing a typescript file. See documentationSolution
I guess it's either reading the tsconfig file to know how to handle imports and exports, or the easiest way of doing it: if an import with an explicit
.js
fails, it can fallback to trying to read the same file but with.ts
The text was updated successfully, but these errors were encountered: