nx
nx copied to clipboard
Generating new library/apps removes "cli" option from angular.json
Current Behavior
I have a repository which uses version 2 of angular.json and we have individual project.json files for each app and lib. I have recently upgraded to Angular 13 and specified the persistent cache configuration manually in angular.json:
"cli": {
"cache": {
"environment": "all",
"path": ".cache/ng"
}
},
The problem is whenever I try to generate a new library/app through nx CLI it removes the above config from angular.json.
Expected Behavior
Generating new apps/libs should retain the "cli" configuration in angular.json.
Steps to Reproduce
I am using nx 14.1.11 but I can see that this exists in nx 13.10 as well. It is easily reproducible.
Environment
> NX Report complete - copy this into the issue template
Node : 16.17.0
OS : darwin x64
npm : 8.15.0
nx : 14.1.11
@nrwl/angular : 14.1.11
@nrwl/cypress : 14.1.11
@nrwl/detox : Not Found
@nrwl/devkit : 14.1.11
@nrwl/eslint-plugin-nx : 14.1.11
@nrwl/express : Not Found
@nrwl/jest : 14.1.11
@nrwl/js : Not Found
@nrwl/linter : 14.1.11
@nrwl/nest : Not Found
@nrwl/next : Not Found
@nrwl/node : Not Found
@nrwl/nx-cloud : 14.6.2
@nrwl/nx-plugin : Not Found
@nrwl/react : Not Found
@nrwl/react-native : Not Found
@nrwl/schematics : Not Found
@nrwl/storybook : 14.1.11
@nrwl/web : Not Found
@nrwl/workspace : 14.1.11
typescript : 4.6.3
---------------------------------------
Community plugins:
rxjs: 6.6.7
single-spa-angular: 6.3.1
@ngneat/spectator: 10.0.1
@storybook/angular: 6.4.21
ngx-build-plus: 13.0.1
nx-stylelint: 12.2.0