From 694ad194f301b67800def2968d5858af5b795055 Mon Sep 17 00:00:00 2001 From: Lxxyx Date: Wed, 7 Jun 2023 03:52:14 +0000 Subject: [PATCH] fix: force exit when build finish #527 --- .changeset/wise-rabbits-press.md | 17 +++++++++++++++++ packages/hooks-kit/src/command/build.ts | 10 ++++++---- 2 files changed, 23 insertions(+), 4 deletions(-) create mode 100644 .changeset/wise-rabbits-press.md diff --git a/.changeset/wise-rabbits-press.md b/.changeset/wise-rabbits-press.md new file mode 100644 index 000000000..19a7739fd --- /dev/null +++ b/.changeset/wise-rabbits-press.md @@ -0,0 +1,17 @@ +--- +'@midwayjs/hooks-kit': patch +'@midwayjs/bundler': patch +'@midwayjs/dev-pack': patch +'@midwayjs/esrun': patch +'@midwayjs/hcc': patch +'@midwayjs/hooks': patch +'@midwayjs/hooks-bundler': patch +'@midwayjs/hooks-core': patch +'@midwayjs/hooks-internal': patch +'@midwayjs/hooks-upload': patch +'@midwayjs/rpc': patch +'@midwayjs/serve': patch +'@midwayjs/test-util': patch +--- + +fix: force exit when build finish #527 diff --git a/packages/hooks-kit/src/command/build.ts b/packages/hooks-kit/src/command/build.ts index 79b33592f..52511538a 100644 --- a/packages/hooks-kit/src/command/build.ts +++ b/packages/hooks-kit/src/command/build.ts @@ -91,11 +91,13 @@ export function setupBuildCommand(cli: CAC) { if (pkg.dependencies['@midwayjs/koa']) { consola.info('Use `npm start` to start server!') } + // https://github.com/midwayjs/hooks/issues/527 + process.exit(0) } catch (e) { - consola.error(`error during build:\n${e.stack}`), - { - error: e, - } + consola.error(`error during build:\n${e.stack}`, { + error: e, + }) + process.exit(1) } }) }