if you are using babel, there's babel-plugin-lodash that can cherry pick lodash functions. It will transform
babel-plugin-lodash
import _ from 'lodash'; _.map([], ()=>{});
to
import _map from 'lodash/map'; _map([], ()=>{});
Add to your babel.config.js
// return { env: { production: { plugins: [ 'lodash', ], }, }, // }
for production builds
Also, replacing momentjs with dayjs could be a one-to-one api replacement where dayjs is less than 3kb
For dayjs that's correct. As for babel that was something I didn't know. Thanks for sharing
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
if you are using babel, there's
babel-plugin-lodash
that can cherry pick lodash functions.It will transform
to
Add to your babel.config.js
for production builds
Also, replacing momentjs with dayjs could be a one-to-one api replacement where dayjs is less than 3kb
For dayjs that's correct. As for babel that was something I didn't know. Thanks for sharing