Skip to content

Commit d12a122

Browse files
authored
BREAKING: Add --poll option (#108)
Adds --poll option as a v2 compatibility measure. However, this new implementation removes the capability to set the interval (supported in v2). Closes #107
1 parent 3df9572 commit d12a122

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

index.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,10 @@ Usage:
8888
desc: 'Watch files for changes and recompile as needed',
8989
type: 'boolean'
9090
})
91+
.option('poll', {
92+
desc: 'Use polling for file watching',
93+
type: 'boolean'
94+
})
9195
.option('x', {
9296
alias: 'ext',
9397
desc: 'Override the output file extension',
@@ -180,7 +184,10 @@ Promise.resolve()
180184
})
181185
.then((results) => {
182186
if (argv.watch) {
183-
const watcher = chokidar.watch(input.concat(dependencies(results)))
187+
const watcher = chokidar.watch(
188+
input.concat(dependencies(results)),
189+
{ usePolling: argv.poll }
190+
)
184191

185192
if (config.file) watcher.add(config.file)
186193

0 commit comments

Comments
 (0)