Skip to content

Commit b1e78d9

Browse files
committed
try symlinking instead of copying
1 parent b104f17 commit b1e78d9

File tree

1 file changed

+3
-17
lines changed
  • packages/react-email/src/commands

1 file changed

+3
-17
lines changed

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

Lines changed: 3 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -222,12 +222,11 @@ export const build = async ({
222222
await fs.promises.rm(builtPreviewAppPath, { recursive: true });
223223
}
224224

225-
spinner.text = 'Copying preview app from CLI to modify it';
225+
spinner.text = 'Copying preview app to modify it';
226226
await fs.promises.cp(previewServerLocation, modifiedPreviewAppPath, {
227227
recursive: true,
228228
filter: (source: string) => {
229229
return (
230-
!/(\/|\\)cli(\/|\\)?/.test(source) &&
231230
!/(\/|\\)\.next(\/|\\)?/.test(source) &&
232231
!/(\/|\\)\.turbo(\/|\\)?/.test(source)
233232
);
@@ -265,24 +264,11 @@ export const build = async ({
265264
await buildPreviewApp(modifiedPreviewAppPath);
266265

267266
await fs.promises.mkdir(builtPreviewAppPath);
268-
await fs.promises.cp(
267+
await fs.promises.symlink(
269268
path.join(modifiedPreviewAppPath, '.next'),
270269
path.join(builtPreviewAppPath, '.next'),
271-
{
272-
recursive: true,
273-
},
274-
);
275-
await fs.promises.cp(
276-
path.join(modifiedPreviewAppPath, 'public'),
277-
path.join(builtPreviewAppPath, 'public'),
278-
{
279-
recursive: true,
280-
},
270+
'dir',
281271
);
282-
283-
await fs.promises.rm(modifiedPreviewAppPath, {
284-
recursive: true,
285-
});
286272
} catch (error) {
287273
console.log(error);
288274
process.exit(1);

0 commit comments

Comments
 (0)