liveBook · Manning

Minification

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

A source transformation that reduces file size by removing unnecessary characters and shortening identifiers without changing behavior.

Minification reduces frontend files before deployment by removing whitespace and comments and shortening variable names without changing application behavior. It is one step in building source code into files the browser can load. section 1.3.1

Minification fits into a broader build process:

  • Bundle application code into fewer files so the browser makes fewer server requests. section 1.3.1
  • Remove whitespace and comments from generated files. section 1.3.1
  • Replace variables with shorter names to make files smaller. section 1.3.1
  • Run the framework’s build command, commonly exposed through an npm script such as npm run build. section 1.3.1
Figure 1.4 A simplified diagram of a frontend application’s build process
figure

A simplified build-process diagram places minification among the transformations that prepare frontend code for delivery. section 1.3.1

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

How deep it goes
Defines three size-reduction operations but stops short of implementing a minifier or discussing optimization algorithms.
Examples
Uses bundled application files, vendor bundles, and npm run build as concrete build-process artifacts.
What it assumes
Assumes familiarity with frontend application development and introduces minification within the build workflow.
What you can do after
Evaluate how frontend source code becomes smaller files shipped to browser users.
How it connects
Connects minification with frontend frameworks, bundling, build processes, JavaScript, and npm scripts.

Also explained in

Compare how 2 books explain minification →

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.