Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(build): explicitly exit process after build to prevent hangup #1530

Merged
merged 4 commits into from Oct 24, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -12,3 +12,4 @@ pnpm-global
TODOs.md
.temp
*.tgz
examples-temp
12 changes: 8 additions & 4 deletions src/node/cli.ts
Expand Up @@ -28,10 +28,14 @@ if (!command || command === 'dev') {
process.exit(1)
})
} else if (command === 'build') {
build(root, argv).catch((err) => {
console.error(c.red(`build error:\n`), err)
process.exit(1)
})
build(root, argv)
.then(() => {
process.exit()
})
.catch((err) => {
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)
Expand Down