Skip to content

chore: prevent lodash inclusion when building esm #540

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

Closed
wants to merge 1 commit into from

Conversation

DavidEspinola
Copy link

@DavidEspinola DavidEspinola commented Aug 11, 2020

Since rollup.config.esm.js is configuring "external" as the full lodash library but imports are including specific modules, this config is not taking effect and Rollup is including a large ammount of lodash code in the ESM bundle.

Fixing this configuration reduces bundle size to less than a half, so I think is something good to include. I'll be happy to include this optimization in my projects.

I have included the version increment and compiled build, but I can remove them if you have another workflow. Fixes #541

Regards

@DavidEspinola DavidEspinola changed the title chore: prevent lodash inclusion when building esm chore: prevent lodash inclusion when building esm. Fixes #541 Aug 12, 2020
@DavidEspinola DavidEspinola changed the title chore: prevent lodash inclusion when building esm. Fixes #541 chore: prevent lodash inclusion when building esm Aug 12, 2020
@DavidEspinola
Copy link
Author

@Akryum What do you think about this? Another option is to use smaller lodash packages like https://www.npmjs.com/package/lodash.merge and https://www.npmjs.com/package/lodash.isequal and populate the Relloup "external" configuration importing package.json dependencies. I can prepare another pull request if you prefer this option.

@Akryum
Copy link
Owner

Akryum commented Dec 30, 2020

Thank you for you PR! Fixed in 12a8dab

@Akryum Akryum closed this Dec 30, 2020
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

Successfully merging this pull request may close these issues.

Rollup is including lodash code inside the ESM build
2 participants