You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi there! I'm using jsx-email in a serverless context (Cloudflare Workers) and noticed my bundle size jumped quite a bit after adding jsx-email. After some investigation it seems that the Code component importing shikiji is the main culprit, adding almost 8MB of uncompressed (1.2Mb gzipped) javascript to the bundle.
This isn't a blocker as I'm still below the worker size limit (although above what they recommend). Still, it seems like it would be nice to allow users to opt-out of this dependency (it's unlikely we'll need code highlighting in our emails!)
I've tried importing components individually, but I guess since renderer references them all it's impossible for them to be tree-shaken? Perhaps you could change the API so that users can pass in a highlighting function to the renderer?
The text was updated successfully, but these errors were encountered:
Thanks for the issue. This is a known problem that we're working on, and also impacts #82. For the moment, the fix is to simply exclude shijiki (in the next major that'll be shiki) in your bundler config.
since renderer references them all
I don't believe that's the issue, but we're def working to improve tree shaking.
Hi there! I'm using jsx-email in a serverless context (Cloudflare Workers) and noticed my bundle size jumped quite a bit after adding jsx-email. After some investigation it seems that the
Code
component importing shikiji is the main culprit, adding almost 8MB of uncompressed (1.2Mb gzipped) javascript to the bundle.This isn't a blocker as I'm still below the worker size limit (although above what they recommend). Still, it seems like it would be nice to allow users to opt-out of this dependency (it's unlikely we'll need code highlighting in our emails!)
I've tried importing components individually, but I guess since renderer references them all it's impossible for them to be tree-shaken? Perhaps you could change the API so that users can pass in a highlighting function to the renderer?
The text was updated successfully, but these errors were encountered: