You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm currently using chart.js for very simple and lightweight Bar and Pie generation with React using react-chartjs-2 Recently, I've noticed that the moment.js dependency of chart.js is biggest chunk in my webpack bundle as shown below:
Overall bundle
Moment.js depenencies
As per the docs: http://www.chartjs.org/docs/latest/axes/cartesian/time.html seems to be the reason why moment.js is included in the first place. But fortunately for me, I do use any time scales. All I use is bar and pie with non-time labels and data.
Question: I was wondering, if there is any solution to prevent this dependency from being loaded in all the non-time chart cases. Further, I wish to enquire if I can import only specific library from chart.js or does
import{Bar,Pie}from'chart.js'
strictly imports only those 2 without any unwanted dependencies?
The text was updated successfully, but these errors were encountered:
I'm currently using chart.js for very simple and lightweight Bar and Pie generation with React using react-chartjs-2 Recently, I've noticed that the
moment.js
dependency ofchart.js
is biggest chunk in my webpack bundle as shown below:Overall bundle
Moment.js depenencies
As per the docs: http://www.chartjs.org/docs/latest/axes/cartesian/time.html seems to be the reason why moment.js is included in the first place. But fortunately for me, I do use any time scales. All I use is bar and pie with non-time
labels
anddata
.Question: I was wondering, if there is any solution to prevent this dependency from being loaded in all the non-time chart cases. Further, I wish to enquire if I can import only specific library from
chart.js
or doesstrictly imports only those 2 without any unwanted dependencies?
The text was updated successfully, but these errors were encountered: