Skip to content

Commit

Permalink
add process signal handlers and specify package manager version (#170)
Browse files Browse the repository at this point in the history
* add process signal handlers

* specify package manager version
  • Loading branch information
0xBigBoss committed Jan 3, 2024
1 parent ba78f20 commit 6c708dc
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,6 @@
"typescript": "^4.7.4",
"webpack": "^5.74.0",
"webpack-cli": "^4.10.0"
}
},
"packageManager": "yarn@1.22.19"
}
14 changes: 13 additions & 1 deletion packages/bundler/src/exec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,18 @@
import { runBundler, showStackTraces } from './runBundler'

void runBundler(process.argv)
process.on('SIGINT', () => {
process.exit(0)
})

process.on('SIGTERM', () => {
process.exit(0)
})

void runBundler(process.argv).then((bundler) => {
process.on('exit', () => {
void bundler.stop()
})
})
.catch(e => {
console.error('Aborted:', showStackTraces ? e : e.message)
process.exit(1)
Expand Down

0 comments on commit 6c708dc

Please sign in to comment.