I have multiple project in same Angular 8 app. In "root" tsconfig.json I add paths for @models
"compilerOptions": { "baseUrl": "./", "outDir": "./dist/out-tsc", "sourceMap": true, "declaration": false, "downlevelIteration": true, "experimentalDecorators": true, "module": "esnext", "moduleResolution": "node", "importHelpers": true, "target": "es2015", "typeRoots": ["node_modules/@types"], "lib": ["es2018", "dom"], "paths": { "@models": ["projects/shared/models"] <=== this } }, I Import from index.ts barrel
export * from "./users/user-profile.model"; export * from "./users/users.model"; When I try In any component import model from @models
import { IUser } from "@models"; I get error
error TS2307: Cannot find module '@models'
But when I try to import it directly from the barrel, working ok
In every of my project, I also have tsconfig.app.json, but I only add the path to the root
"@models": ["projects/shared/models"]shoulde be replaced with"@models": ["projects/shared/models/index.ts"]in tsconfig.json file