Building an Angular app
To build an Angular 10 app, we use the following command of the Angular CLI:
ng build
The build process boots up the Angular compiler that primarily collects all TypeScript files of our application code and converts them into JavaScript. An Angular application contains various TypeScript files that are not generally used during runtime, such as unit tests or tooling helpers. How does the compiler know which files to collect for the build process? Well, it reads the files
property of the tsconfig.app.json
file that indicates the main entry point of an Angular 10 app:
"files": [ "src/main.ts", "src/polyfills.ts" ]
From there, it can go through all components, services, and other Angular artifacts that are needed by our application, as we have already learned in Chapter 1, Building Your First Angular App. The Angular compiler outputs the resulting JavaScript files into a folder named according...