I have the below mono repo folder structure for my Angular application.
I am using library1 and library2 in app1/app2, also publishing both the libraries as .tgz separately to be consumed by other angular applications.
I am using ng-packagr to Compile and package Angular libraries in Angular Package Format (APF).
to create library using below commands :
**ng build --library1**
**npm pack**
In directory/angular.json
"projects": {
"library1": {
"root": "libs/library1",
"sourceRoot": "libs/library1/src",
"projectType": "library",
"prefix": "library1",
"architect": {
"build": {
"builder": "@angular-devkit/build-ng-packagr:build",
"options": {
"tsConfig": "libs/library1/tsconfig.lib.json",
"project": "libs/library1/ng-package.json"
},
"configurations": {
"production": {
"project": "libs/library1/ng-package.prod.json"
}
}
}
}
In directory/libs/library1/ng-package.json
{
"$schema": "../../node_modules/ng-packagr/ng-package.schema.json",
"dest": "../../dist/libs/library1",
"lib": {
"entryFile": "src/index.ts"
}
}
What I Need :
Now I want to combine library1 and library 2 to create a single library may be libraryAll(libraryAll.tgz) which will export libray1 and library 2.
Also I need a shared module which will be consumed by both libraries and will be a part of final library package.


I think that firstly you need to create multi-project structure that angular provides. You can generate libs and apps via the
ng generate liborng generate applicationcommand.Then for your libs you can package. Check this for more info: https://izifortune.com/multiple-packages-repository-with-angular/