Initially, I believed that using path & basePath in tsconfig would allow aliases, but it appears not to be the case.
"moduleResolution": "node",
"baseUrl": "./src",
"paths": {
"@api/*": ["api/*"]
},
import routes from '@api/routes'; // pjroot/src/api/routes.ts (VS Code recognizes this file)
Error: Cannot find module '@api/routes'
Upon compiling the project, I noticed that the aliases @api are not being replaced with paths. Why is that? I prefer to avoid using third-party modules like modulesAlias for such a simple task.
What is the purpose of having aliases in the config if they are not substituted with actual paths during compilation?