From 2ca4b15ec0402e8399c2f829c4c115b2ed48b678 Mon Sep 17 00:00:00 2001 From: Divyansh Singh <40380293+brc-dd@users.noreply.github.com> Date: Thu, 3 Nov 2022 13:01:01 +0530 Subject: [PATCH 1/2] revert(#1530): explicitly exit process after build to prevent hangup This is exiting the process before streams can finish (https://github.com/vuejs/vitepress/issues/520#issuecomment-1301710349). --- src/node/cli.ts | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/node/cli.ts b/src/node/cli.ts index 1d95c3e7358..397558bb570 100644 --- a/src/node/cli.ts +++ b/src/node/cli.ts @@ -28,11 +28,7 @@ if (!command || command === 'dev') { process.exit(1) }) } else if (command === 'build') { - build(root, argv) - .then(() => { - process.exit() - }) - .catch((err) => { + build(root, argv).catch((err) => { console.error(c.red(`build error:\n`), err) process.exit(1) }) From 239aa4bc2bdb4c85f429efd19dd3b50c5a2e4004 Mon Sep 17 00:00:00 2001 From: Divyansh Singh <40380293+brc-dd@users.noreply.github.com> Date: Thu, 3 Nov 2022 13:01:40 +0530 Subject: [PATCH 2/2] format --- src/node/cli.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/node/cli.ts b/src/node/cli.ts index 397558bb570..0d992fab8e4 100644 --- a/src/node/cli.ts +++ b/src/node/cli.ts @@ -29,9 +29,9 @@ if (!command || command === 'dev') { }) } else if (command === 'build') { build(root, argv).catch((err) => { - console.error(c.red(`build error:\n`), err) - process.exit(1) - }) + console.error(c.red(`build error:\n`), err) + process.exit(1) + }) } else if (command === 'serve') { serve(argv).catch((err) => { console.error(c.red(`failed to start server. error:\n`), err)