Closed ghost closed 4 years ago
Instead of importing all of loadash, let's just import the functions we need! This will reduce the bundle size in the end!
loadash
Before:
[justin.zelinsky@Justins-MBP dist (master)]$ ls -l total 1512 -rw-r--r-- 1 justin.zelinsky staff **556180** May 13 18:09 funnies.dev.js -rw-r--r-- 1 justin.zelinsky staff 11703 May 13 18:06 funnies.js -rw-r--r-- 1 justin.zelinsky staff **85769** May 13 18:09 funnies.min.js -rw-r--r-- 1 justin.zelinsky staff 3180 May 13 18:06 index.js -rw-r--r-- 1 justin.zelinsky staff 4114 May 13 18:06 react.js
After:
[justin.zelinsky@Justins-MBP dist (master)]$ ls -l total 200 -rw-r--r-- 1 justin.zelinsky staff **45149** May 13 18:11 funnies.dev.js -rw-r--r-- 1 justin.zelinsky staff 11703 May 13 18:06 funnies.js -rw-r--r-- 1 justin.zelinsky staff **26245** May 13 18:11 funnies.min.js -rw-r--r-- 1 justin.zelinsky staff 3322 May 13 18:11 index.js -rw-r--r-- 1 justin.zelinsky staff 4114 May 13 18:06 react.js
You're welcome!
Instead of importing all of
loadash
, let's just import the functions we need! This will reduce the bundle size in the end!Before:
After: