Skip to content

Commit 2cdedf5

Browse files
committed
Refactor
1 parent f679362 commit 2cdedf5

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/cli.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -367,8 +367,13 @@ async function build() {
367367
let input = args['--input']
368368
let output = args['--output']
369369
let shouldWatch = args['--watch']
370+
let shouldCoalesceWriteEvents = process.platform === 'win32'
370371
let includePostCss = args['--postcss']
371372

373+
// Polling interval in milliseconds
374+
// Used only when coalescing add/change events on Windows
375+
let pollInterval = 10
376+
372377
// TODO: Deprecate this in future versions
373378
if (!input && args['_'][1]) {
374379
console.error('[deprecation] Running tailwindcss without -i, please provide an input file.')
@@ -748,10 +753,10 @@ async function build() {
748753
watcher = chokidar.watch([...contextDependencies, ...extractFileGlobs(config)], {
749754
ignoreInitial: true,
750755
awaitWriteFinish:
751-
process.platform === 'win32'
756+
shouldCoalesceWriteEvents
752757
? {
753758
stabilityThreshold: 50,
754-
pollInterval: 10,
759+
pollInterval: pollInterval,
755760
}
756761
: false,
757762
})

0 commit comments

Comments
 (0)