Skip to content

Commit f599430

Browse files
authored
Configure awaitWriteFinish for chokidar (#5774)
* Configure `awaitWriteFinish` for chokidar * Enable `awaitWriteFinish` on Windows only
1 parent a7c89c8 commit f599430

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

src/cli.js

+7
Original file line numberDiff line numberDiff line change
@@ -700,6 +700,13 @@ async function build() {
700700

701701
watcher = chokidar.watch([...contextDependencies, ...extractFileGlobs(config)], {
702702
ignoreInitial: true,
703+
awaitWriteFinish:
704+
process.platform === 'win32'
705+
? {
706+
stabilityThreshold: 50,
707+
pollInterval: 10,
708+
}
709+
: false,
703710
})
704711

705712
let chain = Promise.resolve()

src/lib/setupWatchingContext.js

+7
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,13 @@ function rebootWatcher(context, configPath, configDependencies, candidateFiles)
8484

8585
watcher = chokidar.watch([...candidateFiles, ...configDependencies], {
8686
ignoreInitial: true,
87+
awaitWriteFinish:
88+
process.platform === 'win32'
89+
? {
90+
stabilityThreshold: 50,
91+
pollInterval: 10,
92+
}
93+
: false,
8794
})
8895

8996
setWatcher(context, watcher)

0 commit comments

Comments
 (0)