I'm using ts-node and in tsconfig.json
I have "baseUrl": "./src"
. This way I can import a sibling in src
without using ./
. However ts-node does not seem to using the baseUrl
property in resolving the sibling imports, so I get errors like this:
> tsmochanyc@1.0.0 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)
Curious whether this is a ts-node bug or whether I should be doing something different?