Answer the question
In order to leave comments, you need to log in
How to make Typescript compiler recalculate paths relative to baseUrl in JS output code?
To avoid long import paths, I use the `baseUrl` typescript parameter in my `tsconfig.json`:
{
"compilerOptions": {
...
"baseUrl": "./"
},
...
}
import foo from "../../../../hello/foo"
import foo from "hello/foo"
module.js:474
throw err;
^
Error: Cannot find module 'hello/foo'
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question