Learn Measure Blog Live About

Minify JavaScript

Updated
Appears in: Performance audits

Minifying JavaScript files can reduce payload sizes and script parse time. The Opportunities section of your Lighthouse report lists all unminified JavaScript files, along with the potential savings in kibibytes (KiB) when these files are minified:

A screenshot of the Lighthouse Minify JavaScript audit

How to minify your JavaScript files

Minification is the process of removing whitespace and any code that is not necessary to create a smaller but perfectly valid code file. Terser is a popular JavaScript compression tool. webpack v4 includes a plugin for this library by default to create minified build files.

Resources

Last updated: Improve article