Skip to content
Draft
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
14 changes: 11 additions & 3 deletions src/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,11 @@ let commands = {
type: Boolean,
description: 'Disable autoprefixer',
},
'--ignore-stdin': {
type: Boolean,
description:
'Disable stdin listeners. Only use in combination with --watch flag.\n\t\t\t For use when running tailwindcss cli as a child process without connection to parent stdin',
},
'-c': '--config',
'-i': '--input',
'-o': '--output',
Expand Down Expand Up @@ -418,6 +423,7 @@ async function build() {
let shouldPoll = args['--poll']
let shouldCoalesceWriteEvents = shouldPoll || process.platform === 'win32'
let includePostCss = args['--postcss']
let ignoreStdIn = args['--ignore-stdin'] || false

// Polling interval in milliseconds
// Used only when polling or coalescing add/change events on Windows
Expand Down Expand Up @@ -885,9 +891,11 @@ async function build() {
}

if (shouldWatch) {
/* Abort the watcher if stdin is closed to avoid zombie processes */
process.stdin.on('end', () => process.exit(0))
process.stdin.resume()
if (!ignoreStdIn) {
/* Abort the watcher if stdin is closed to avoid zombie processes */
process.stdin.on('end', () => process.exit(0))
process.stdin.resume()
}
startWatcher()
} else {
buildOnce()
Expand Down