Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow including only used LODASH functions in app bundle #1082

Closed
PavelPZ opened this issue Dec 22, 2016 · 2 comments
Closed

Allow including only used LODASH functions in app bundle #1082

PavelPZ opened this issue Dec 22, 2016 · 2 comments

Comments

@PavelPZ
Copy link

PavelPZ commented Dec 22, 2016

Using e.g.

import isEqual from 'lodash/isEqual';
if (!isEqual(obj1, obj2)) return;

instead of

import * as _ from 'lodash';
if (!_.isEqual(obj1, obj2)) return;

can save app bundle size.
e.g. if using JSPM package manager with Rollup Optimization.

@jeffcarbs
Copy link
Member

Duplicate of #830, see this comment: #830 (comment)

We have this done automatically by babel using https://github.com/lodash/babel-plugin-lodash. Compare the src and dist directories to see it in action.

@PavelPZ
Copy link
Author

PavelPZ commented Dec 23, 2016

@jcarbo, that's great, thanks for clarification.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants