-
Notifications
You must be signed in to change notification settings - Fork 97
Stripping JSPDF and html2canvas dependencies #200
-
Firstly, thankyou for this library. The visualisations are absolutely beautiful and working wonderfully in my project.
One bugbear I have though unfortunately is the overhead of the jsPDF library and html2canvas dependency that it is also bringing in.
These result in about 560kb of output bundles when I build my project using Vite, and I am not using any PDF functionality at all.
Is anyone aware of a way to strip these dependencies from the bundled output? These unused dependencies currently represent about 10% of the size of my bundled project.
Beta Was this translation helpful? Give feedback.
All reactions
Replies: 1 comment 5 replies
-
@davidfishlock thanks for your comments:)
I'm considering moving JsPdf to peer deps.
Will keep you posted.
Beta Was this translation helpful? Give feedback.
All reactions
-
👍 1
-
That would be great. Am I correct in thinking that would also apply to html2canvas since 707cb5a ?
Beta Was this translation helpful? Give feedback.
All reactions
-
html2canvas was removed from deps altogether, as I'm using a custom image generation method; but still ships with JsPdf apparently.
Beta Was this translation helpful? Give feedback.
All reactions
-
Yeah looking at the bundle output it still seems to be there due to jspdf as you say.
Beta Was this translation helpful? Give feedback.
All reactions
-
v2.9.0 ships with jspdf as peer dep, stripping out a nice chunk from the bundle.
Beta Was this translation helpful? Give feedback.
All reactions
-
Wow that was quick! Amazing I will check that out tomorrow thankyou!
Beta Was this translation helpful? Give feedback.
All reactions
-
👍 1