Skip to content

Commit f0557c2

Browse files
committed
fix (vs-code-ext): build preview files not being deleted for files that are not email templates
1 parent d826af7 commit f0557c2

File tree

3 files changed

+9
-1
lines changed

3 files changed

+9
-1
lines changed

vs-code-extension/CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@ All notable changes to the "react-email-preview" extension will be documented in
44

55
## [Unreleased]
66

7+
## 0.0.1 - 2023-11-04
8+
9+
### Fixes
10+
11+
- Fixed build files not being deleted for files that are not email templates
12+
713
## 0.0.0 - 2023-11-04
814

915
Released first version for testing.

vs-code-extension/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "react-email-preview",
33
"displayName": "react-email preview",
44
"description": "A easy way to view the preview of a email made with react-email from your editor",
5-
"version": "0.0.0",
5+
"version": "0.0.1",
66
"license": "MIT",
77
"publishConfig": {
88
"access": "public"

vs-code-extension/src/renderOpenEmailFile.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,8 @@ export async function renderOpenEmailFile(
5858
const email = require(builtFileWithCurrentContents);
5959

6060
if (typeof email.default === "undefined") {
61+
await unlink(builtFileWithCurrentContents);
62+
6163
// this means there is no "export default ..." in the file
6264
return { valid: false };
6365
}

0 commit comments

Comments
 (0)