Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Stripping JSPDF and html2canvas dependencies #200

davidfishlock started this conversation in General
Discussion options

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.

You must be logged in to vote

Replies: 1 comment 5 replies

Comment options

@davidfishlock thanks for your comments:)

I'm considering moving JsPdf to peer deps.
Will keep you posted.

You must be logged in to vote
5 replies
Comment options

That would be great. Am I correct in thinking that would also apply to html2canvas since 707cb5a ?

Comment options

html2canvas was removed from deps altogether, as I'm using a custom image generation method; but still ships with JsPdf apparently.

Comment options

Yeah looking at the bundle output it still seems to be there due to jspdf as you say.

Comment options

@davidfishlock

v2.9.0 ships with jspdf as peer dep, stripping out a nice chunk from the bundle.

Comment options

Wow that was quick! Amazing I will check that out tomorrow thankyou!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file

AltStyle によって変換されたページ (->オリジナル) /