pdfme / pdfme

A TypeScript based PDF generator library, made with React.
https://pdfme.com
MIT License
2.16k stars 192 forks source link

UI bundle size optimization: development react/react-dom files included in UI prod build fix #423

Closed olga-krayevska closed 3 months ago

olga-krayevska commented 3 months ago

Is your feature request related to a problem? Please describe.

Hello @hand-dot, again, thank you for great lib) I’ve noticed rather big bundle size of UI package: pdfme-issue-1

I’ve checked it with bundle visualizer and there are both development and production react and react-dom files included: pdfme-issue-2

Describe the solution you'd like

I’ve checked Vite docs for possible solution for that and have found that defining process.env.NODE_ENV in Vite configs fixes it: pdfme-issue-3 pdfme-issue-4 only production files are included

my PR: https://github.com/pdfme/pdfme/pull/422

Describe alternatives you've considered

I've got no alternative solutions

Additional context

No response

hand-dot commented 3 months ago

Hey @olga-krayevska, I'm happy you contributed again. Thank you.

I've merged the PR, so I'll close it. It's scheduled to be included in the next release.