Closed yangshun closed 7 years ago
Heh that's on my to-do list (: Will help in tree shaking too I believe
On Sep 13, 2016 10:39 PM, "Melvin Lee" notifications@github.com wrote:
Consider importing the individual lodash methods to reduce webpack build file size.
Before:
import from 'lodash'; const foo = .find(someArr, (item) => item.id === 'bar');
After:
import find from 'lodash/find'; const foo = find(someArr, (item) => item.id === 'bar');
However this is easier said than done because some of the functions use the seq chain. Might have to replace it with currying instead:
https://medium.com/making-internets/why-using-chain-is-a-mistake-9bc1f80d51ba
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.
Fixed via 096beb7aa5b10ecfcbad8d5aad958831af0b9707. Cheated and used https://github.com/lodash/babel-plugin-lodash instead.
From @zyml on September 13, 2016 14:39
Consider importing the individual lodash methods to reduce webpack build file size.
Before:
After:
However this is easier said than done because some of the functions use the
seq
chain. Might have to replace it with currying instead:https://medium.com/making-internets/why-using-chain-is-a-mistake-9bc1f80d51ba
Copied from original issue: nusmodifications/nusmods-v3#14