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
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
-
-
-
-
-
-
-
Automated optimization of JavaScript and CSS2m 24s
-
JavaScript bundling vs. modules4m 21s
-
JavaScript loading: Async and defer5m 4s
-
Lazy-loading JavaScript modules with import()6m 29s
-
Minifying and uglifying JavaScript4m 26s
-
Critical CSS7m 53s
-
Deferring noncritical CSS2m 57s
-
Component-based CSS loading1m 25s
-
-
-
-