election-live
election-live copied to clipboard
Cherry pick lodash to decrease bundle size?
I've seen that this project is using lodash. Maybe it will better to use lodash with "cherry pick" import to reduce the bundle size.
For example instead of using
import _ from 'lodash'
_.random()
Use this instead
import random from 'lodash/random'
Can also use import { random } from 'lodash' and use babel-plugin-lodash
Yesterday, I tried to add gatsby-lodash-plugin main problem is they don't allow us to use _.chain. So we need to change it to _.compose instead.
Use flow instead of _.chain krub and other functions from lodash/fp instead of lodash.