Folder structure:
--shared
---components
---states
---api-interfaces
I would like to use @lib/api-interfaces
within states and components instead:
relative path: ../../../foo/xxx/bar/{...}.ts
;.
Is there a way to do it?
You can do this by adding the path to your tsconfig.json
located at the root of the project.
{
"compilerOptions": {
"rootDir": ".",
"baseUrl": ".",
"paths": {
"@lib/api-interfaces": ["/path/to/shared/api-interfaces.ts"],
}
},
}
ng g @nrwl/workspace:lib api-interfaces
This way the lib is configured in the tsconfig, nx.json, angular.json and you don't have to manually add it. Caution, this may remove any existing code so backup first.