@@ -161,6 +161,7 @@ let commands = {
161
161
'--input' : { type : String , description : 'Input file' } ,
162
162
'--output' : { type : String , description : 'Output file' } ,
163
163
'--watch' : { type : Boolean , description : 'Watch for changes and rebuild as needed' } ,
164
+ '--poll' : { type : Boolean , description : 'Poll for changes every so often and rebuild' } ,
164
165
'--content' : {
165
166
type : String ,
166
167
description : 'Content paths to use for removing unused classes' ,
@@ -187,6 +188,7 @@ let commands = {
187
188
'-o' : '--output' ,
188
189
'-m' : '--minify' ,
189
190
'-w' : '--watch' ,
191
+ '-p' : '--poll' ,
190
192
} ,
191
193
} ,
192
194
}
@@ -367,11 +369,12 @@ async function build() {
367
369
let input = args [ '--input' ]
368
370
let output = args [ '--output' ]
369
371
let shouldWatch = args [ '--watch' ]
370
- let shouldCoalesceWriteEvents = process . platform === 'win32'
372
+ let shouldPoll = args [ '--poll' ]
373
+ let shouldCoalesceWriteEvents = shouldPoll || process . platform === 'win32'
371
374
let includePostCss = args [ '--postcss' ]
372
375
373
376
// Polling interval in milliseconds
374
- // Used only when coalescing add/change events on Windows
377
+ // Used only when polling or coalescing add/change events on Windows
375
378
let pollInterval = 10
376
379
377
380
// TODO: Deprecate this in future versions
@@ -751,6 +754,8 @@ async function build() {
751
754
}
752
755
753
756
watcher = chokidar . watch ( [ ...contextDependencies , ...extractFileGlobs ( config ) ] , {
757
+ usePolling : shouldPoll ,
758
+ interval : shouldPoll ? pollInterval : undefined ,
754
759
ignoreInitial : true ,
755
760
awaitWriteFinish :
756
761
shouldCoalesceWriteEvents
0 commit comments