Bun doesn't support tsconfig.json which consist of references to other tsconfigs
What version of Bun is running?
1.0.0+822a00c4d508b54f650933a73ca5f4a3af9a7983
What platform is your computer?
Darwin 22.6.0 arm64 arm
What steps can reproduce the bug?
- Create main
tsconfig.jsonand anothertsconfig.app.json - In the
tsconfig.app.jsonadd
{
"compilerOptions": {
"baseUrl": ".",
"paths": {
"@/*": ["./src/*"]
}
}
}
- In the
tsconfig.jsonadd
{
"files": [],
"references": [
{
"path": "./tsconfig.app.json"
}
],
}
- In the code, import something using created
@alias
What is the expected behavior?
Imports using alias work as expected.
What do you see instead?
"Cannot find module" error occurs:
As soon as you add paths in the main tsconfig.json, it works as expected:
(Don't mind other errors, I'm playing around with an existing Vue project and it seems that Bun isn't able to work with it).
Additional information
In conclusion, I guess that Bun doesn't take into account other tsconfigs referenced by the main tsconfig.
I'm working on monorepo and also have multiple tsconfig with root config and others are referencing to it. Facing same issue that paths aren't considered and ending up with error that Bun can't resolve @someAlias/dir/file
Same as @zavodnyuk, i have multiples tsconfig references.
is there any workaround ?