electron-userland / electron-compile

DEPRECATED: Electron supporting package to compile JS and CSS in Electron applications
1.01k stars 99 forks source link

watchPath calls subscribers multiple times #189

Open Mike-Dax opened 7 years ago

Mike-Dax commented 7 years ago

This is likely a problem with fs, file changes call subscribers twice each time.

MarshallOfSound commented 7 years ago

Tbh the easiest solution to this is a simple debounce 😆

Mike-Dax commented 7 years ago

Seems to happen at intervals up to a second and a half after the original change event on my machine. A debounce feels like a hacky fix to me?

MarshallOfSound commented 7 years ago

@Mike-Dax Probably due to a meta-data change being delayed by your editor. Chokidar actually does content checks I think to make it way more accurate 👍

Mike-Dax commented 7 years ago

@MarshallOfSound Even renaming a file in Finder does the same thing :\

anaisbetts commented 7 years ago

Peep https://github.com/electron/electron-compile/blob/master/src/live-reload.js#L56