From aa0d2aa392b562b48871d359056f68a3bbb9d4e6 Mon Sep 17 00:00:00 2001 From: Tim Branyen Date: Fri, 2 Jun 2017 17:42:41 -0700 Subject: [PATCH] Can't figure out why these last tests are failing --- index.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index c0c035b..67e4393 100755 --- a/index.js +++ b/index.js @@ -29,6 +29,7 @@ Object.defineProperty(LiveReloadPlugin.prototype, 'isRunning', { }); LiveReloadPlugin.prototype.start = function start(watching, cb) { + this.compilation = watching; var port = this.port; var quiet = this.quiet; if (servers[port]) { @@ -54,7 +55,7 @@ LiveReloadPlugin.prototype.start = function start(watching, cb) { }; LiveReloadPlugin.prototype.done = function done(stats) { - var timestamps = stats && stats.compilation && stats.compilation.fileTimestamps || {}; + var timestamps = this.compilation ? this.compilation.fileTimestamps : {}; this.changedFiles = Object.keys(timestamps).filter(function(watchfile) { return this.startTime < Math.ceil(statSync(watchfile).mtime); @@ -63,7 +64,7 @@ LiveReloadPlugin.prototype.done = function done(stats) { this.startTime = Date.now(); var assets = stats.compilation.assets; - const include = []; + var include = []; this.changedFiles.forEach(function(changedFile) { Object.keys(assets).forEach(function(assetName) {