Skip to content

Question: is it possible to reduce the size of an ESBuild-generated bundle packaging @react-pdf? #3305

@Lucas-C

Description

@Lucas-C

Hi!

Thank you very much for this wonderful library 🫶

We are using it in some TypeScript application,
and we generate a final JS bundle using esbuild.

This tool allows to inspect the list of dependencies bundled, with treeshaking enabled.
While trying to find opportunities to reduce our JS bundle size, I got the following stats:

# Top-5 biggest package dependencies, with absolute & relative size in the JS bundle produced:

brotli@1.3.3/node_modules/brotli/dec/dictionary-data.js                                              0.72 MiB  10.53%
fontkit@2.0.4/node_modules/fontkit/dist/module.mjs                                                   0.52 MiB   7.60%
@react-pdf+pdfkit@4.1.0/node_modules/@react-pdf/pdfkit/lib/pdfkit.js                                 0.40 MiB   5.82%
@react-pdf+reconciler@2.0.0_react@19.2.4/node_modules/@react-pdf/reconciler/lib/reconciler-33.js     0.27 MiB   3.96%
@react-pdf+reconciler@2.0.0_react@19.2.4/node_modules/@react-pdf/reconciler/lib/reconciler-31.js     0.24 MiB   3.51%

When looking at this report I was just wondering:
is it normal to have both reconciler-31.js & reconciler-33.js embedded?
Isn't one renderer enough?

Sorry if this is a silly question, maybe both are obsviously necessary and I'm just missing background knowledge on react-pdf internals 😅

Regards

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions