@@ -161,6 +161,10 @@ let commands = {
161161 '--input' : { type : String , description : 'Input file' } ,
162162 '--output' : { type : String , description : 'Output file' } ,
163163 '--watch' : { type : Boolean , description : 'Watch for changes and rebuild as needed' } ,
164+ '--poll' : {
165+ type : Boolean ,
166+ description : 'Use polling instead of filesystem events when watching' ,
167+ } ,
164168 '--content' : {
165169 type : String ,
166170 description : 'Content paths to use for removing unused classes' ,
@@ -187,6 +191,7 @@ let commands = {
187191 '-o' : '--output' ,
188192 '-m' : '--minify' ,
189193 '-w' : '--watch' ,
194+ '-p' : '--poll' ,
190195 } ,
191196 } ,
192197}
@@ -367,11 +372,12 @@ async function build() {
367372 let input = args [ '--input' ]
368373 let output = args [ '--output' ]
369374 let shouldWatch = args [ '--watch' ]
370- let shouldCoalesceWriteEvents = process . platform === 'win32'
375+ let shouldPoll = args [ '--poll' ]
376+ let shouldCoalesceWriteEvents = shouldPoll || process . platform === 'win32'
371377 let includePostCss = args [ '--postcss' ]
372378
373379 // Polling interval in milliseconds
374- // Used only when coalescing add/change events on Windows
380+ // Used only when polling or coalescing add/change events on Windows
375381 let pollInterval = 10
376382
377383 // TODO: Deprecate this in future versions
@@ -751,6 +757,8 @@ async function build() {
751757 }
752758
753759 watcher = chokidar . watch ( [ ...contextDependencies , ...extractFileGlobs ( config ) ] , {
760+ usePolling : shouldPoll ,
761+ interval : shouldPoll ? pollInterval : undefined ,
754762 ignoreInitial : true ,
755763 awaitWriteFinish : shouldCoalesceWriteEvents
756764 ? {
0 commit comments