-
Couldn't load subscription status.
- Fork 25
Add support for imports that use tsconfig.json baseUrl #1292
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
Conversation
|
@seveibar Please review |
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.
see comments
Co-authored-by: Severin Ibarluzea <seve700@gmail.com>
|
@seveibar I have resolved comments |
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.
Rename viaPaths, same thought as before
|
|
||
| if (!unknownFilePath.startsWith("./") && !unknownFilePath.startsWith("../")) { | ||
| const viaTsconfig = resolveWithTsconfigPaths({ | ||
| const resolvedPathFromPaths = resolveWithTsconfigPaths({ |
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.
| const resolvedPathFromPaths = resolveWithTsconfigPaths({ | |
| const resolvedPathFromTsconfigPaths = resolveWithTsconfigPaths({ |
|
@seveibar Thanks for merging |
/claim #1282
/closes #1282
Fixes issue #1282 by making sure don't need to specify "paths" in tsconfig in order to import files from the root directory
Created 3 test cases to verify it works
TEST LOGS:
USER@DESKTOP-1PHUG1C MINGW64 ~/3D Objects/eval (fix-1282)
$ bun test tests/features/tsconfig-paths-resolution.test.tsx
bun test v1.2.23 (cf136713)
tests\features\tsconfig-paths-resolution.test.tsx:
✓ resolves imports using tsconfig paths aliases [1391.00ms]
✓ throws error when tsconfig path alias cannot be resolved (instead of trying jsdelivr)
✓ resolves imports using tsconfig baseUrl [609.00ms]
3 pass
0 fail
5 expect() calls
Ran 3 tests across 1 file. [3.97s]