This tsconfig.json is out of my package folder, it is in the node_module/cache folder. When I use tsc-alias to transform the alias configured by tsconfig.json, I got this exception:
Solution
This line shows that you judge if it's an alias references a file outside the baseUrl via aliasPath.path.includes('..').However this line shows that aliasPath.path is a path relative to configDir (not baseUrl). So I changed it to a path relative baseUrl.
And I try to run jest after my change, but got an error no tsc-alias command founded. It seems to be a pnpm problem in my environment:
❯ pnpm link -g
WARN link:/Users/helium/Desktop/tsc-alias has no binaries
So if there is something wrong with Jest result, please notify me. Thanks for your review.
My problem
I met a problem when use this tool. Here is my
tsconfig.json
:This
tsconfig.json
is out of my package folder, it is in thenode_module/cache
folder. When I usetsc-alias
to transform the alias configured bytsconfig.json
, I got this exception:Solution
This line shows that you judge if it's an alias references a file outside the
baseUrl
viaaliasPath.path.includes('..')
.However this line shows thataliasPath.path
is a path relative toconfigDir
(notbaseUrl
). So I changed it to a path relativebaseUrl
.And I try to run
jest
after my change, but got an errorno tsc-alias command founded
. It seems to be a pnpm problem in my environment:So if there is something wrong with Jest result, please notify me. Thanks for your review.