-
Notifications
You must be signed in to change notification settings - Fork 11.9k
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
Is it possible to remove moment.js dependency? #4739
Comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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: