Skip to content

Commit

Permalink
Refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
thecrypticace committed Mar 2, 2022
1 parent f679362 commit f77f1a7
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions src/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -367,8 +367,13 @@ async function build() {
let input = args['--input']
let output = args['--output']
let shouldWatch = args['--watch']
let shouldCoalesceWriteEvents = process.platform === 'win32'
let includePostCss = args['--postcss']

// Polling interval in milliseconds
// Used only when coalescing add/change events on Windows
let pollInterval = 10

// TODO: Deprecate this in future versions
if (!input && args['_'][1]) {
console.error('[deprecation] Running tailwindcss without -i, please provide an input file.')
Expand Down Expand Up @@ -747,13 +752,12 @@ async function build() {

watcher = chokidar.watch([...contextDependencies, ...extractFileGlobs(config)], {
ignoreInitial: true,
awaitWriteFinish:
process.platform === 'win32'
? {
stabilityThreshold: 50,
pollInterval: 10,
}
: false,
awaitWriteFinish: shouldCoalesceWriteEvents
? {
stabilityThreshold: 50,
pollInterval: pollInterval,
}
: false,
})

let chain = Promise.resolve()
Expand Down

0 comments on commit f77f1a7

Please sign in to comment.