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

Reduce bundle size / tree shaking #1570

Open
MickL opened this issue Dec 6, 2024 · 0 comments
Open

Reduce bundle size / tree shaking #1570

MickL opened this issue Dec 6, 2024 · 0 comments

Comments

@MickL
Copy link

MickL commented Dec 6, 2024

Bundle size is critical for both web browsers as well as serverless functions. Unfortunately using just a few basic functions already adds 1,18 mb (299 kb gzipped).

It would be great if bundle size would be reduced. One way to do so would be to allow tree shaking instead of importing everthing, e.g.:

import { PDFDocument, registerFont, image, fontSize } from 'pdfkit';

const doc = new PDFDocument(options);
doc.pipe(registerFont('...'), image('...'), fontSize(9))

Possibly related: #1367

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant