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: add --watchStdin option to exit when stdin ends #19092

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

stevehodgkiss
Copy link

Description

Fixes #19091

Adds an optional --watchStdin flag and config and defaults to !process.stdin.tty (true when stdin is a pipe). The CLI flag allows this default to be overridden if it causes issues. I've tested running under Elixir (see linked issue) and the following script to start and stop a vite server programmatically (from issue #4079):

import { createServer } from 'vite'

const viteServer = await createServer()
await viteServer.close()
// pnpm exec node test-shutdown.js

Fixes the issue with running Vite under Elixir and doesn't cause issues
when running Vite programmatically [1]

[1] vitejs#4079
@stevehodgkiss stevehodgkiss force-pushed the stevehodgkiss/fix-stdin-eof-exit branch from 975e966 to 3ce8058 Compare December 29, 2024 00:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Server doesn't exit when STDIN is closed
1 participant