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

Big bundle size #561

Closed
bagaskarala opened this issue Oct 17, 2019 · 3 comments
Closed

Big bundle size #561

bagaskarala opened this issue Oct 17, 2019 · 3 comments

Comments

@bagaskarala
Copy link

How to get small bundled dependencies? i think it still huge size

Actual Behavior

chart js bundle

Environment

  • vue.js version: 2.6.10
  • vue-chart.js version: 3.4.2
  • npm version: 6.4.1
@apertureless
Copy link
Owner

apertureless commented Oct 17, 2019

Hi @bagaskarala

well, this has nothing to do with vue-chartjs. Because vue-chartjs itself is very small. 3.49kb minified.

Chart.js itself is quite huge. You should minify and gzip your bundle for production. If 46kb minified + gzipped is still to huge for you, I guess you have to look for a smaller charting solution :)

Check out their documentation of choosing the right bundle: https://www.chartjs.org/docs/latest/getting-started/installation.html#selecting-the-correct-build

As vue-chartjs is importing chartjs, you can chose the bundle by setting an alias in your webpack.conf and pointing to the bundle you want.

@bagaskarala
Copy link
Author

so in my screenshot it use nonminified chart.js? so how i point to chart.min.js?

@apertureless
Copy link
Owner

Well it depends if you are analyzing your development build or your production build.

In general (depending on your webpack.conf) you will minify your production build.
And then you have to analyze it and see if chart.js really is that big.

You can point it in the alias section.

Just take a look at this issue: #124

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

2 participants