Skip to content

Commit e3cf4a2

Browse files
committed
feat(react-email): Polished way of ensuring email binary is available for demo & web (#2224)
1 parent de31064 commit e3cf4a2

File tree

3 files changed

+9
-4
lines changed

3 files changed

+9
-4
lines changed

packages/react-email/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
},
88
"scripts": {
99
"build": "tsup-node && node ./scripts/build-preview-server.mjs",
10-
"prepare": "pnpm turbo build",
10+
"postbuild": "pnpm install --frozen-lockfile",
1111
"caniemail:fetch": "node ./scripts/fill-caniemail-data.mjs",
1212
"clean": "rm -rf dist",
1313
"dev": "tsup-node --watch",

packages/react-email/src/cli/commands/build.ts

+1
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,7 @@ const updatePackageJson = async (builtPreviewAppPath: string) => {
170170
};
171171
packageJson.scripts.build = 'next build';
172172
packageJson.scripts.start = 'next start';
173+
delete packageJson.scripts.postbuild;
173174

174175
packageJson.name = 'preview-server';
175176
// We remove this one to avoid having resolve issues on our demo build process.

turbo.json

+7-3
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,15 @@
1010
],
1111
"tasks": {
1212
"build": {
13-
"dependsOn": ["^build"],
13+
"dependsOn": ["^build", "^postbuild"],
1414
"outputs": ["dist/**"]
1515
},
16+
"postbuild": {
17+
"dependsOn": ["build"],
18+
"cache": false
19+
},
1620
"web#build": {
17-
"dependsOn": ["^build"],
21+
"dependsOn": ["^build", "^postbuild"],
1822
"env": [
1923
"RESEND_API_KEY",
2024
"NEXT_PUBLIC_SUPABASE_URL",
@@ -23,7 +27,7 @@
2327
"outputs": [".next/**", "!.next/cache/**"]
2428
},
2529
"demo#build": {
26-
"dependsOn": ["^build"],
30+
"dependsOn": ["^build", "^postbuild"],
2731
"outputs": [".react-email/**", "!.react-email/.next/cache/**"]
2832
},
2933
"react-email#build": {

0 commit comments

Comments
 (0)