-
Notifications
You must be signed in to change notification settings - Fork 778
feat(react-email): Remove existing out
directory when running email export
#1373
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
add in code to delete the PathToWhereEmailMarkupShouldBeDumped , out by default, if it already exists to make sure the directory only displays current and correct files when exporting to remove the chance of duplications and errors.
@bennyburrito is attempting to deploy a commit to the resend Team on Vercel. A member of the Team first needs to authorize it. |
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Could you also run |
@gabrielmfern how would I go about doing that? Sorry, not really done this before :) |
@bennyburrito You will have to clone your fork, that you've created to make these changes — through GitHub I assume — and then checkout into the new |
out
directory when running email export
I have done that and refactored the code. when running pnpm install and pnpm format, all appears to be working correctly and no errors thrown. |
@bennyburrito |
Thanks for the heads up. All committed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is good to go! Thank you so much for contributing.
Just happy to help in some way :) FYI it is a great project that we are looking at including for our new email system at work so keep up the good work. |
…l export` (#1373) Co-authored-by: Ben Verspeak <[email protected]>
This change unfortunately broke my workflow. I'm exporting both |
Hi @kdoroszewicz, we had a similar issue with ours and also needed a text version. The solution I came up with was to add a script that generates a TXT version based on the HTML version that is created in the out directory and saves the TXT version into the out directory as well. We liked this solution as it means the TXT version is automatically kept up to date as it is generated from the HTML. This means you don't have to remember to change the TXT version if you change copy in the HTML version. We used npm html-to-text to do this and now we have no issues with it. https://www.npmjs.com/package/html-to-text It would be good if the built-in export script could create a TXT version as well as a HTML version when the out directory is created. |
I'm relaying on '--plaintext' flag available in react-email CLI - no extra package required. The CLI just doesn't handle generating both versions at once so this change destroys the output of the previous command. |
It would be good if they could look at that and the flag could be applied once the directory has been made so it can handle both versions at once. |
@bennyburrito - agreed it would be nice to output multiple formats at once. As a workaround, I updated my script: |
add in code to delete the PathToWhereEmailMarkupShouldBeDumped , out by default, if it already exists to make sure the directory only displays current and correct files when exporting to remove the chance of duplications and errors.