digisfera / lr-http-server

An HTTP server with livereload included
31 stars 9 forks source link

Adding new files after server launch are not detected by gaze #5

Closed pflannery closed 7 years ago

pflannery commented 7 years ago

This is because it's watching files using absolute paths. At this line

The fix for this would be to gaze at the relative paths instead.

    gaze(watchFiles, function(err, watcher) {
      if(err) {
        console.error("Unable to watch files", err);
      }
      this.on('all', function(event, filepath) {
        console.log(filepath + ' was ' + event);
        livereloadServer.changed({body:{files:filepath}});
      });
    });

@manuelcabral I can PR this.

manuelcabral commented 7 years ago

Thanks, please do.

For reference, some corresponding gaze issues are #84 and #80.