@nx-extend/react-email
v6.1.1
Published
<a href="https://www.npmjs.com/package/@nx-extend/react-email" rel="nofollow"> <img src="https://badgen.net/npm/v/@nx-extend/react-email" alt="@nx-extend/react-email NPM package"> </a>
Readme
@nx-extend/react-email
Nx plugin for building emails with React Email.
Features
- Build and preview emails using React components
- Live development server for email templates
- Export emails to static HTML
- Full TypeScript support
- Integration with Nx workspace
Setup
Install
npm install -D @nx-extend/react-email
nx g @nx-extend/react-email:initUsage
Serve
Start the React Email development server to preview your email templates:
nx serve <project-name>Available options:
| Name | Type | Default | Description |
|------------|----------|---------|---------------------------------------|
| port | string | - | Port to run the development server on |
Export
Export your email templates to static HTML files:
nx export <project-name>Available options:
| Name | Type | Default | Description |
|-------------------|----------|---------|------------------------------------|
| outputPath | string | - | Output path to output the build to |
Examples
Start Development Server
nx serve my-emails --port=3000Export Email Templates
nx export my-emails --outputPath=dist/emailsProject Structure
After initialization, your project will typically have the following structure:
my-emails/
├── src/
│ └── emails/
│ └── welcome.tsx
└── project.jsonCreate email components in the src/emails directory using React Email components.
