-
Notifications
You must be signed in to change notification settings - Fork 871
Description
Describe the Bug
The bundle size of our app increased by ~500 MB when we installed react-email. The reason for this is that the react-email package requires several large dependencies like next and framer-motion.
While it makes sense that these are required for the dev tools/build tools, they shouldn't be included if I make react-email a devDependency and keep @react-email/components a depenency.
The reason that react-email is still installed even when moving it to a devDependency is that @react-email/markdown has a dependency on md-to-react-email: 4.1.0 (here). The 4.x version of md-to-react-email has a peer dependency on react-email. Unfortunately, with yarn there is no way to ignore peer dependencies entirely, even when running with --production flag.
Solution
If the package @react-email/markdown bumps its dependency md-to-react-email to 5.x then the issue will be resolved because it is no longer listed as a peer dependency..
References
Which package is affected (leave empty if unsure)
@react-email/components
Link to the code that reproduces this issue
https://github.com/codeskills-dev/md-to-react-email/blob/v4.1.0/package.json#L50C1-L50C28
To Reproduce
- Install
@react-email/componentsas a dependency in a new project - Install dependencies via
yarn install - Check if
react-emailwas installed viayarn why react-email - Assert that
react-emailis installed
Expected Behavior
- Install
@react-email/componentsas a dependency in a new project - Install dependencies via
yarn install - Check if
react-emailwas installed viayarn why react-email - Assert that
react-emailis NOT installed
What's your node version? (if relevant)
20.10.0