diff --git a/.changeset/wise-rabbits-press.md b/.changeset/wise-rabbits-press.md new file mode 100644 index 00000000..19a7739f --- /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 79b33592..52511538 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) } }) }