Skip to content

Commit 6d24d2c

Browse files
committed
try copying only the .next directory
1 parent 76746e9 commit 6d24d2c

File tree

1 file changed

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

1 file changed

+11
-17
lines changed

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

Lines changed: 11 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -213,11 +213,6 @@ export const build = async ({
213213
spinner.text = 'Deleting pre-existing modified preview app folder';
214214
await fs.promises.rm(modifiedPreviewAppPath, { recursive: true });
215215
}
216-
const builtPreviewAppPath = path.join(process.cwd(), '.react-email');
217-
if (fs.existsSync(builtPreviewAppPath)) {
218-
spinner.text = 'Deleting pre-existing .react-email folder';
219-
await fs.promises.rm(builtPreviewAppPath, { recursive: true });
220-
}
221216

222217
spinner.text = 'Copying preview app from CLI to modify it';
223218
await fs.promises.cp(cliPackageLocation, modifiedPreviewAppPath, {
@@ -261,25 +256,24 @@ export const build = async ({
261256
});
262257
await buildPreviewApp(modifiedPreviewAppPath);
263258

264-
await fs.promises.mkdir(builtPreviewAppPath);
265259
await fs.promises.cp(
266260
path.join(modifiedPreviewAppPath, '.next'),
267-
path.join(builtPreviewAppPath, '.next'),
268-
{
269-
recursive: true,
270-
},
271-
);
272-
await fs.promises.cp(
273-
path.join(modifiedPreviewAppPath, 'public'),
274-
path.join(builtPreviewAppPath, 'public'),
261+
path.join(process.cwd(), '.next'),
275262
{
276263
recursive: true,
277264
},
278265
);
266+
// await fs.promises.cp(
267+
// path.join(modifiedPreviewAppPath, 'public'),
268+
// path.join(builtPreviewAppPath, 'public'),
269+
// {
270+
// recursive: true,
271+
// },
272+
// );
279273

280-
await fs.promises.rm(modifiedPreviewAppPath, {
281-
recursive: true,
282-
});
274+
// await fs.promises.rm(modifiedPreviewAppPath, {
275+
// recursive: true,
276+
// });
283277
} catch (error) {
284278
console.log(error);
285279
process.exit(1);

0 commit comments

Comments
 (0)