Skip to content

Commit

Permalink
fix(react-email): Respect user NODE_ENV (#1756)
Browse files Browse the repository at this point in the history
Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: gabriel miranda <[email protected]>
  • Loading branch information
3 people committed Jan 9, 2025
1 parent c6fcd94 commit e4e1a36
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/early-mugs-divide.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"react-email": patch
---

Respect user's NODE_ENV when previewing templates
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,10 @@ export const startDevServer = async (
// these environment variables are used on the next app
// this is the most reliable way of communicating these paths through
process.env = {
...process.env,
NODE_ENV: 'development',
...(process.env as Omit<NodeJS.ProcessEnv, 'NODE_ENV'> & {
NODE_ENV?: NodeJS.ProcessEnv['NODE_ENV'];
}),
...getEnvVariablesForPreviewApp(
// If we don't do normalization here, stuff like https://github.com/resend/react-email/issues/1354 happens.
path.normalize(emailsDirRelativePath),
Expand Down

0 comments on commit e4e1a36

Please sign in to comment.