1egoman / funnies

:stuck_out_tongue_winking_eye: Make users laugh when your app loads.
https://1egoman.github.io/funnies/
MIT License
178 stars 54 forks source link

CHORE: Import only the necessary lodash functions #119

Closed ghost closed 4 years ago

ghost commented 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!

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
ghost commented 4 years ago

You're welcome!