Minification, explained
Developers write code with spacing and comments so people can read it. Browsers do not need any of that, so a build tool strips it before the site goes live.
JavaScript tools can go further and shorten variable names. CSS tools can merge repeated rules and shorten values.
It works together with compression. Minification removes what is not needed, and then gzip or Brotli shrinks what remains on the way to the browser.
You keep your readable source in your project and ship the small version. Source maps can link the two for debugging. It only shrinks code, so it will not fix a site that loads too much of it.



