Optimizing the application bundle
As we learned in the Building an Angular 10 app section, the Angular CLI performs optimization techniques when we build an Angular 10 app in production mode. The optimization process that is performed in the application code includes modern web techniques and tools, including the following:
- Minification: Converts multiline source files into a single line by removing whitespaces and comments. It is a process that enables browsers to parse them faster later on.
- Uglification: Renames properties and methods to a non-human-readable form so that they are difficult to understand and used for malicious purposes.
- Bundling: Concatenates all source files of the application into a single file, called the bundle.
- Tree-shaking: Removes unused files and Angular artifacts such as components and modules, resulting in a smaller bundle.
As we can see, the Angular CLI does a tremendous job for us as far as build optimization is concerned. However...