Skip to content

Conversation

@julioflima
Copy link

@julioflima julioflima commented Nov 7, 2025

To able to build locally and use NextJS just changing the root dir.


Summary by cubic

Made path handling in the React Email build generic so local Next.js builds work even if the project root changes. Preview server path now points to .react-email in the project root instead of a hard-coded build output.

  • Bug Fixes
    • Set USER_PROJECT_LOCATION via path.resolve(__dirname, "../") instead of process.cwd.
    • Set PREVIEW_SERVER_LOCATION to path.join(userProjectLocation, ".react-email") instead of builtPreviewAppPath.

Written for commit 1287ded. Summary will update automatically on new commits.

Copilot AI review requested due to automatic review settings November 7, 2025 04:23
@changeset-bot
Copy link

changeset-bot bot commented Nov 7, 2025

⚠️ No Changeset found

Latest commit: 1287ded

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@vercel
Copy link

vercel bot commented Nov 7, 2025

@julioflima is attempting to deploy a commit to the resend Team on Vercel.

A member of the Team first needs to authorize it.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR refactors the dynamic next.config.js generation in the build command to use proper Node.js path methods instead of string interpolation for path construction.

  • Replaced hardcoded process.cwd() string interpolation with path.resolve(__dirname, "../") for determining the user project location
  • Replaced hardcoded builtPreviewAppPath string interpolation with path.join(userProjectLocation, reactEmailDir) for the preview server location
  • Introduced a reactEmailDir constant to avoid hardcoding the .react-email directory name

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@pkg-pr-new
Copy link

pkg-pr-new bot commented Nov 7, 2025

Open in StackBlitz

npm i https://pkg.pr.new/resend/react-email@2657

commit: 1287ded

Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 1 file

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant