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

Exit when STDIN closes #1004

Closed
wants to merge 3 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions src/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ program
'--hmr-hostname <hostname>',
'set the hostname of HMR websockets, defaults to location.hostname of current window'
)
.option('--stdin', 'exit the process when stdin is closed')
.option('--no-hmr', 'disable hot module replacement')
.option('--no-cache', 'disable the filesystem cache')
.option('--no-source-maps', 'disable sourcemaps')
Expand Down Expand Up @@ -150,6 +151,12 @@ async function bundle(main, command) {
process.env.NODE_ENV = process.env.NODE_ENV || 'development';
}

if (command.stdin) {
process.stdin.on('end', () => process.exit(0));
process.stdin.resume();

}

if (command.cert && command.key) {
command.https = {
cert: command.cert,
Expand Down