Browsers cannot use Angular templates containing expressions directly. The Angular compiler transforms those templates into JavaScript statements that use browser APIs to create HTML elements and evaluate expressions. The TypeScript compiler has a separate job: compiling TypeScript files into JavaScript. section 9.3.2
Running `ng serve` starts a development build. Webpack follows imports from `main.ts`, processes the application’s dependencies, and bundles the compiled output for the browser. The Angular development tools manage this process; the compiler is not normally run separately in this workflow. section 9.3.2 section 3.1
Rebuild after a template change
Replace `src/app/app.component.html` with `<div>Hello, World</div>` while the development tools are running. The build reports an updated `main.js` bundle and a successful compilation. This connects a template edit to the browser-ready build without treating the template as browser-executable source. section 9.3.2
Table 9.7. The bundles produced by the Angular build process
|
Name
|
Description
|
|
main.js
|
This file contains the compiled output produced from the
src/app folder.
|
|
polyfills.js
|
This file contains JavaScript polyfills required for features used by the application not supported by the target browsers.
|
|
runtime.js
|
This file contains the code that loads the other modules.
|
|
styles.js
|
This file contains JavaScript code that adds the application’s global CSS stylesheets.
|
|
vendor.js
|
This file contains the third-party packages the application depends on, including the Angular packages.
|
Compare `main.js`, which contains compiled application output, with the other bundles. The Angular compiler transforms templates; bundling packages that output alongside other resources. section 9.3.2
