From the course: Developing for Web Performance

Unlock this course with a free trial

Join today to access over 22,500 courses taught by industry experts.

Minifying and uglifying JavaScript

Minifying and uglifying JavaScript

From the course: Developing for Web Performance

Minifying and uglifying JavaScript

- JavaScript is code written by humans for computers. And as I've mentioned before, while we humans need human readable code, with lots of white space, and indentation, and comments, computers do not. For this reason. When we ship code to the browser, we can optimize that code for performance by removing all the white space and comments, and long variable and function names, and basically rewrite everything and turn it into highly optimized human unreadable code. For this, we use code monifiers, and uglyfires and mangloes called soul, because of how they rewrite our beautiful code, into an ugly mangled computer mess. There are lots of JavaScript magnifiers to choose from, and all major bunglers, including webpack, rollup, parcel, et cetera, ship with magnifiers built in. The two most popular magnifiers are ugliyph JS, and terser. Though terser has started to pull ahead, because it produces smaller code and works better.…

Contents