apps/docs/getting-started/monorepo-setup/bun.mdx
Create a new folder called transactional inside of where you keep workspace packages (generally ./packages/*).
Include a new package.json and do not forget to add this to the workspaces of your monorepo's package.json.
<Card title="React Email + Turborepo + bun example" icon="arrow-up-right-from-square" href="https://github.com/resend/react-email-turborepo-bun-example"
See the full source code </Card>
Install React Email to the transactional workspace.
bun add react-email -D -E
bun add @react-email/components react react-dom -E
Include the following script in your package.json file.
{
// ...
"scripts": {
"dev": "email dev"
}
// ...
}
Create a new folder called emails, create a file inside called email.tsx and add the following example code:
import { Button, Html, Head, Body } from "@react-email/components";
import * as React from "react";
export default function Email() {
return (
<Html>
<Head />
<Body>
<Button
href="https://example.com"
style={{ background: "#000", color: "#fff", padding: "12px 20px" }}
>
Click me
</Button>
</Body>
</Html>
);
}
Start the email previews development server:
bun dev
Visit localhost:3000 and edit the emails/email.tsx file to see the changes.
<Card title="React Email + Turborepo + bun example" icon="arrow-up-right-from-square" href="https://github.com/resend/react-email-turborepo-bun-example"
See the full source code </Card>