-
Notifications
You must be signed in to change notification settings - Fork 589
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
@react-email/tailwind Package dist size is too large #1101
Comments
It certainly is something that we want to improve on and that isn't in the least optimal. The best way I found to do it was to bundle it as it is, |
I have the same problem. I can't push the code to the next.js edge runtime because react emails bundle is way too large. A main problem I see is the js-beautify lib. |
Same problem here
509mb of disk sizes in my docker image any way to reduce it? |
@jlopezxs This issue is about the For the Also, there was an issue we fixed a while ago that might improve the size for you, so upgrading is also something you can do. |
Is this something that should be documented in the docs? I was also having trouble with my bundle size, and your suggestion worked wonderfully. I can't imagine it would hurt having a smaller production bundle size, especially for serverless environments. |
Describe the Bug
I am trying to use react-email with TRPC and Next.js I ran a profiler on the output of
next build
with@next/bundle-analyzer
It said the largest package was coming from@react-email/tailwind/dist/index.mjs
I am running Next.js with Open-Next deployed with SST on a Lambda in AWS. The larger the Node.js portion of the next.js code is, the longer it takes for the lambda to start. Currently it looks like
@react-email/tailwind
is 6.5MBAt first glance, it looks like it's pulling in all of tailwindcss and postcss here: https://github.com/resend/react-email/blob/canary/packages/tailwind/src/utils/get-css-for-markup.ts#L1-L4
Is there a way we can make this package smaller?
Which package is affected (leave empty if unsure)
No response
Link to the code that reproduces this issue
https://github.com/resend/react-email/tree/canary/packages/tailwind
To Reproduce
Run
next build
with@next/bundle-analyzer
Expected Behavior
The dist folder to be smaller.
What's your node version? (if relevant)
No response
The text was updated successfully, but these errors were encountered: