Reputation:
Both the lines below are contributing the same size to the bundle.
import _ from "lodash";
import { get } from "lodash";
I am expecting Line-2 to be of less size. ( Refer to the image )
Named imports cost less in Ant Design which is not working in lodash.
Is there a way to reduce this?
Upvotes: 2
Views: 117
Reputation: 3996
The below line should do the job.
import get from 'lodash/get'
Yes, Ant Design named imports would give you the component you import.
This functionality is yet to be seen in lodash.
Upvotes: 2