liveBook · Manning

Webpack

As explained in Pro Angular 16

Webpack is a JavaScript module bundler that analyzes module dependencies and produces bundles for application delivery.

Webpack is a module bundler that follows imports from main.ts, processes dependent files, and consolidates compiled application code into browser-deliverable bundles. section 9.3.2

An Angular development build combines several kinds of output:

  • main.js contains compiled application code from src/app. section 9.3.2
  • vendor.js contains third-party packages, including Angular packages. section 9.3.2
  • runtime.js loads other modules, while polyfills.js and styles bundles provide browser compatibility and global styles. section 9.3.2
...
Initial Chunk Files   | Names         |  Raw Size
vendor.js             | vendor        |   2.17 MB |
styles.css, styles.js | styles        | 341.65 kB |
polyfills.js          | polyfills     | 328.81 kB |
main.js               | main          |  46.32 kB |
runtime.js            | runtime       |   6.51 kB |
                      | Initial Total |   2.87 MB
...

The build summary shows bundle names, sizes, and the initial total produced during development. section 9.3.2

Following an application change

Running ng serve starts the build. Webpack begins at main.ts, follows imports, and reports changed bundles such as main.js and runtime.js; unchanged chunks remain unchanged. section 9.3.2

How Pro Angular 16 covers it

How deep it goes
Explains dependency traversal, compilation inputs, bundle roles, and development output, while deferring direct webpack operation and production builds.
Examples
Uses main.ts dependency traversal, ng serve output, bundle summaries, and changed main.js and runtime.js artifacts.
What it assumes
Assumes an Angular project using TypeScript, templates, imports, and ng serve, while defining bundling and its place in the build pipeline.
What you can do after
Evaluate development build output by identifying entry points, dependencies, generated bundles, and reported changes.
How it connects
Connects module bundling with TypeScript compilation, Angular compilation, import dependencies, Angular development tools, and browser delivery.

Also explained in

Compare how 2 books explain Webpack →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Pro Angular 16. The section links point to the parts of the book it draws on.