Currently, I am working with ts-node and within my tsconfig.json
, I have set the "baseUrl": "./src"
. With this configuration, I am able to import a sibling from the src
directory without the need for the ./
prefix. However, it appears that ts-node is not utilizing the baseUrl
property when resolving these sibling imports, resulting in errors like the one below:
> [email protected] test /home/ole/Junk/tsmochanyc
> mocha -r ts-node/register src/**/*.spec.ts
Error: Cannot find module 'hello'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:548:15)
I am wondering whether this issue is related to a bug in ts-node or if there is something else I should be doing differently to resolve it?