Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Which builder to use when using nx with angular.json

I migrated an existing angular project to use nx. But I am not quite sure if I did it the correct way, as the performance is very poor.

I now switched from

"builder": "@angular-devkit/build-angular:browser",

to

"builder": "@nrwl/web:build",

and it seems that the performance got better. But there are more, for example:

"builder": "@nrwl/angular:webpack-browser",
"builder": "@nrwl/angular:ng-packagr-lite",

Is it correct to use web:build? What are the differences? Unfortunately I cannot find a good explanation on their website. Anybody can point me to the right direction? Which builder to use when? What are the differences?

like image 296
timtos Avatar asked Sep 11 '25 15:09

timtos


1 Answers

I know it's been a couple of months, but for the sake of completeness: the ngPackagr one should be used for libraries only, as specified in their repo. Is that what you were trying to do? Also, what did you mean by poor performance?

If it's any reference (or for future visitors) I just created an NX app and it came with @angular-devkit/build-angular:browser by default.

like image 112
Alejandro L. Avatar answered Sep 13 '25 05:09

Alejandro L.