Coding task · JavaScript and React course · Module 9: Modern React Hooks

Practice: Bundle Analysis

In reduce the sum grows by the size of every element. The compare function of sort returns a negative number when a should come before b, so for descending order subtract the size of a from the size of b.

Task

A bundle analyzer (e.g. rollup-plugin-visualizer in Vite) saved the sizes of the app modules after compression. Complete the report: ___BLANK1___ is the size of a single module (a field of the item object) that reduce adds to the sum, ___BLANK2___ is the compare expression that orders the modules from the biggest to the smallest, and ___BLANK3___ is the condition that is true for a module bigger than the BUDGET. The report should show a total size of 742 kB, a list from star-map (310 kB) to navigation (24 kB), and with the checkbox ticked only the three modules above 100 kB, the candidates for splitting out with lazy().