In your angular.json
file, you have a build
object in your library tree. Inside build
, you have a configurations
object, that contains a production
object and probably a development
object too.
Inside build
object define a new property called defaultConfiguration
, and set the value: production
that match with the name of the production
property inside configurations
object.
Your angular.json
file should look like this:
"architect": {
build": {
"builder": "@angular-devkit/build-ng-packagr:build",
"options": {
"tsConfig": "projects/ngx-custom-tooltip/tsconfig.lib.json",
"project": "projects/ngx-custom-tooltip/ng-package.json"
},
"configurations": {
"production": {
"tsConfig": "projects/ngx-custom-tooltip/tsconfig.lib.prod.json"
},
"development": {
"tsConfig": "projects/ngx-custom-tooltip/tsconfig.lib.json"
}
},
"defaultConfiguration": "production"
},
...
}
Your tsconfig.lib.prod.json
should contains this object:
"angularCompilerOptions": {
"enableIvy": false
}
Finally, yo can execute ng build your-library-name