Minification
A production build strips comments, spacing, and long local names so the same JavaScript or CSS ships in fewer bytes.
See it
What it is
Minification rewrites source into fewer bytes without changing what it does. It removes comments and unnecessary whitespace, shortens local names where safe, and simplifies expressions. Build tools commonly run Terser or an equivalent for JavaScript and cssnano for CSS before the files are compressed for transfer. Terser is the maintained fork of UglifyJS, which is why people still say they uglify a build.
Reach for it on production assets, after deleting unused code. Minification and Brotli stack: minification removes characters, then Brotli encodes the remaining patterns more compactly. It is distinct from tree shaking, which removes whole unreachable exports and modules.
Gotcha: the output is hostile to debugging. Generate source maps for error reporting, but do not expose private source through publicly served maps by accident. Preserve required license comments, and test code that depends on function or class names before enabling name mangling.
Ask AI for it
Minify this production build with Terser for JavaScript and cssnano for CSS. Remove comments and whitespace, enable safe compression and name mangling, preserve comments matched by @license or @preserve, and emit source maps for the error tracker without publishing .map files from the public asset directory. Keep development output readable. Compare raw and Brotli-compressed bytes before and after, run the test suite against the minified build, and report any code that relies on Function.name or Class.name.