As already explained to me in THIS question (thank you by the way), i can use TS configuration file to provide baseUrl
and paths
to be able to reduce nonsense paths like ../../../../someModule
to way shorter, aliased versions like @AliasPath/someModule
. So, I modified my tsconfig.app.json
(please note, I modified .app.json config file, not main tsconfig.json in root folder) file with following line:
....
"baseUrl": "./",
....
"paths": {
"@services/*" : ["app/services/*", "src/app/services/*"]
}
In code I try to import one service by:
import { CommunicationService } from "@services/communication.service";
Project is building fine, but TypeScript is unable to recognize my defined path aliases, marking them with red squiggle line:
And reporting missing files in problem tab:
The question is, how can I instruct TypeScript (because I assume it's TypeScript issue) about my paths aliases?