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

Entire Lodash Library Is Loaded!! 200kb chunk! #179

Closed
DmacMcgreg opened this issue Aug 23, 2017 · 6 comments
Closed

Entire Lodash Library Is Loaded!! 200kb chunk! #179

DmacMcgreg opened this issue Aug 23, 2017 · 6 comments

Comments

@DmacMcgreg
Copy link

You are loading the entire lodash library which is added 200kbs to my webpack bundle.
Can you not just use the lodash.merge library or even use lodash-es library?

untitled_clipping_082317_040720_pm

@apertureless
Copy link
Owner

Oh I will check this. I am actually using import merge from 'lodash/fp/merge' and thought this will only load the merge function 🤔

@DmacMcgreg
Copy link
Author

There are 3 options, we can use the lodash.merge librar

  1. Use the lodash.merge library
  2. Use the lodash-es library
  3. Use another merge algorithm

I'll investigate and make a PR today!

Cheers!

@rriemann
Copy link

Please be aware of this issue. Maybe it is related.

s/app.js 2.85 kB 13 [emitted] app
js/manifest.js 1.73 kB 14 [emitted] manifest
app.85248a3e60a89725a8ca01782364614a.css 157 kB 13 [emitted] app
index.html 1.09 kB [emitted]

ERROR in ./node_modules/vue-chartjs/es/helpers/options.js
Module not found: Error: Can't resolve 'lodash/fp/merge' in '/opt/build/repo/node_modules/vue-chartjs/es/helpers'
@ ./node_modules/vue-chartjs/es/helpers/options.js 8:13-39
@ ./node_modules/vue-chartjs/es/BaseCharts/Scatter.js
@ ./node_modules/vue-chartjs/es/index.js
@ ./src/components/PieChart.js

@apertureless apertureless self-assigned this Aug 28, 2017
@apertureless
Copy link
Owner

Will be fixed in the next release.

Lodash removed entirely as a dependency and replaced with Object.assign()

@apertureless apertureless added this to the 2.8.3 milestone Sep 2, 2017
@coremyslo
Copy link

coremyslo commented Sep 22, 2017

lodash.merge still a dependency in vue-chartjs@2.8.7
https://github.com/apertureless/vue-chartjs/blob/develop/package.json

@apertureless
Copy link
Owner

Yes because object.assign does not work for deep nested objects. And the chart options can have deep nested objects.

However now lodash.merge is a dependency and not lodash . Which results in smaller bundle size.

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

No branches or pull requests

4 participants