Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Angular - Difference between "optimization" and "buildOptimizer" in the build config (angular.json)

Tags:

angular

build

Can someone explain me exactly the difference between those two flags (optimization and buildOptimizer) defined in the build config angular.json during the build process when I execute ng build? The official build documentation isn't clear to me.

like image 285
Evoltafreak Avatar asked May 06 '20 08:05

Evoltafreak


1 Answers

buildOptimizer optimizes the transpilation of TS to JS (remove unused code, add tslib,..) More detailed explanation in the readme of the package https://www.npmjs.com/package/@angular-devkit/build-optimizer

optimization flag I think this one indicates the execution of some Webpack plugins. As in what to do with the JS after the buildOptimizer

like image 153
Alexander Avatar answered Sep 21 '22 14:09

Alexander