diff --git a/src/cli.js b/src/cli.js index 7f3fc8dd3d34..3acbaa28ac38 100644 --- a/src/cli.js +++ b/src/cli.js @@ -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.') @@ -748,10 +753,10 @@ async function build() { watcher = chokidar.watch([...contextDependencies, ...extractFileGlobs(config)], { ignoreInitial: true, awaitWriteFinish: - process.platform === 'win32' + shouldCoalesceWriteEvents ? { stabilityThreshold: 50, - pollInterval: 10, + pollInterval: pollInterval, } : false, })