liveBook · Manning

Bundling

As explained in Build a Frontend Web Framework (From Scratch)

The process of combining source modules or related assets into fewer output files for delivery.

Bundling combines application source files into fewer JavaScript files so browsers can load a frontend application with fewer server requests. It is one step in the broader build process. section 1.3.1

A typical frontend build separates several responsibilities:

  • Transform component templates into JavaScript that creates each component’s view. section 1.3.1
  • Combine application component code into an application bundle such as app.bundle.js. section 1.3.1
  • Combine third-party dependencies into a vendor bundle such as vendors.bundle. section 1.3.1
  • Optionally produce multiple bundles and lazy-load them when larger applications need code later. section 1.3.1

A framework build

After development, a framework CLI can run a command such as npm run build. The resulting files may include app.bundle.js for application code and vendors.bundle for third-party code. Minification may further reduce file size by removing whitespace and comments and shortening variable names. section 1.3.1

Figure 1.4 A simplified diagram of a frontend application’s build process
figure

A simplified build-process diagram helps connect template compilation, code transformation, bundling, and delivery. section 1.3.1

How Build a Frontend Web Framework (From Scratch) covers it

How deep it goes
Explains a simplified multi-step build process and common output bundles, without implementing a bundler or covering production completeness.
Examples
Uses app.bundle.js, vendors.bundle, npm run build, multiple bundles, and lazy-loaded output as concrete artifacts and operations.
What you can do after
Operate a framework-provided build command that emits application and third-party bundles for frontend deployment.
How it connects
Connects bundling with frontend frameworks, template compilation, build processes, minification, vendor code, and lazy loading.

Also explained in

Compare how 9 books explain bundling →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Build a Frontend Web Framework (From Scratch). The section links point to the parts of the book it draws on.