I am looking for some help for my angular 13 library cross dependency import.
I have library api and library shared. I want to import some models from api-library into the shared library.
Now i am having the following problem. If i want to import these models into the shared library i am getting the following error: Cannot find module '@api-library' or its corresponding type declarations.. But if am building the shared library with the model imports i am getting no error and the build succeed.
public-api.ts from the api library (i am exporting everything in the whole library):
export * from './lib/api/api';
export * from './lib/api.module';
export * from './lib/model/models';
shared library tsconfig.lib.ts:
{
"extends": "../../tsconfig.json",
"compilerOptions": {
"outDir": "../../out-tsc/lib",
"declaration": true,
"declarationMap": true,
"inlineSources": true,
"types": [],
"experimentalDecorators": true,
"emitDecoratorMetadata": true,
"forceConsistentCasingInFileNames": true,
"baseUrl": "./",
"paths": {
"@api-library": [
"../../projects/api/src/public-api.ts",
],
"@api-library/*": [
"../../projects/api/src/lib/*",
]
}
},
"exclude": [
"src/test.ts",
"**/*.spec.ts"
],
}
shared library tsconfig.build.ts:
{
"extends": "./tsconfig.lib.json",
"compilerOptions": {
"declarationMap": false,
"paths": {
"@api-library": ["../../dist/api"],
"@shared": ["../../dist/shared"],
"@store": ["../../dist/store"]
}
},
"angularCompilerOptions": {
"compilationMode": "partial"
}
}