fix: #1418 Set file watch option usePolling to true on macOS (#1430)

* fix: #1418

* Remove debug code
This commit is contained in:
Ran Luo 2019-10-03 21:26:55 +08:00 committed by Felix Häusler
parent 344df06d58
commit 6d2d0fabe0

View File

@ -134,7 +134,8 @@ class Watcher {
// Watch a file or directory and return a unwatch function. // Watch a file or directory and return a unwatch function.
watch (win, watchPath, type = 'dir'/* file or dir */) { watch (win, watchPath, type = 'dir'/* file or dir */) {
const usePolling = this._preferences.getItem('watcherUsePolling') // TODO: Is it needed to set `watcherUsePolling` ? because macOS need to set to true.
const usePolling = isOsx ? true : this._preferences.getItem('watcherUsePolling')
const id = getUniqueId() const id = getUniqueId()
const watcher = chokidar.watch(watchPath, { const watcher = chokidar.watch(watchPath, {