Skip to content

Commit 9e46fca

Browse files
fix(react-email): Add Windows support for build process (#1699)
Co-authored-by: gabriel miranda <[email protected]>
1 parent e029c47 commit 9e46fca

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

packages/react-email/build-preview-server.mjs

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
import { spawn } from 'node:child_process';
22
import fs from 'node:fs';
33

4-
const nextBuildProcess = spawn('next', ['build'], {
4+
const nextBuildProcess = spawn('pnpm', ['next', 'build'], {
55
detached: true,
6-
stdio: "inherit"
6+
shell: true,
7+
stdio: 'inherit',
78
});
89

910
process.on('SIGINT', () => {
@@ -12,6 +13,7 @@ process.on('SIGINT', () => {
1213

1314
nextBuildProcess.on('exit', (code) => {
1415
if (code !== 0) {
16+
console.error(`next build failed with exit code ${code}`);
1517
process.exit(code);
1618
}
1719

@@ -21,4 +23,3 @@ nextBuildProcess.on('exit', (code) => {
2123
fs.mkdirSync('dist/preview', { recursive: true });
2224
fs.renameSync('.next', 'dist/preview/.next');
2325
});
24-

0 commit comments

Comments
 (0)