diff --git a/lib/index.js b/lib/index.js index 81c0966..a1943c3 100644 --- a/lib/index.js +++ b/lib/index.js @@ -49,7 +49,9 @@ module.exports = function(root, opts) { // when a file is modifed tell all clients to reload it watcher.on('change', function(file) { - fn.reload(urlsByFile[file]) + setTimeout(function(){ + fn.reload(urlsByFile[file]) + }, opts.delay || 0); }) // build a RegExp to match all watched file extensions