I'm trying to use the paths property in tsconfig.json in a NodeJS project.
In tsconfig.json I have something like this:
"baseUrl": ".",
"paths": {
"@myApp/server/*": [
"server/src/*"
],
"@myApp/common/*": [
"common/src/*"
]
},
Running tsc outputs all JS files as expected, but they retain the @myApp... imports. As a result, node won't run as it can't resolve all modules having as path @myApp....
I can't find a way to convert the paths I've set in tsconfig.json to a value that can be used by node. I've only found this question on SO, but it's quite outdated and it does not lead to a clean solution.
Do we have a way to transpile TS to JS in a way in which we are able to use paths?
tsconfig.jsonis correct. The problem is that the absolutepathsdefined intsconfig.jsondont't work in JS, and I'm looking for a way to convert them to relative paths.