`ng serve` starts the Angular development tools in a project folder. It builds the application for the browser and starts a local web server, so you can test changes without manually rebuilding. Run it from the folder containing the Angular project. section 2.2.2 section 5.1.5
Run the application
From the project folder, run `ng serve`, wait for `Compiled successfully`, then open `http://localhost:4200`. The server uses port 4200 and serves `index.html` by default. Run `ng serve --open` if you want a browser window to open when the server starts. Save a change to a file in `src`; the tools automatically compile and package the changed application. section 2.2.2 section 5.1.5
The development build uses the TypeScript compiler to turn TypeScript into JavaScript and the Angular compiler to turn templates into JavaScript that creates elements and evaluates expressions. Webpack starts at `main.ts`, follows imports to find dependencies, and bundles the compiled output for the browser. These tools are managed by the Angular development tools; you do not need to run them separately. This is the development build, not the build used to prepare an application for deployment. 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.
|
The bundle table identifies the browser resources reported by a development build, including application code, third-party packages, runtime code, polyfills and styles. section 9.3.2
