From c96905b075577c94d4012a4b6a265c1e874d63ff Mon Sep 17 00:00:00 2001 From: QWp6t Date: Sun, 11 Sep 2016 18:47:46 -0700 Subject: [PATCH] Use closure instead of doneCompiling() method. Fixes #1717 --- assets/build/webpack.plugin.browsersync.js | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/assets/build/webpack.plugin.browsersync.js b/assets/build/webpack.plugin.browsersync.js index a55ae7bc5f..c51351e2d0 100644 --- a/assets/build/webpack.plugin.browsersync.js +++ b/assets/build/webpack.plugin.browsersync.js @@ -21,15 +21,14 @@ module.exports = class { return; } this.compiler = compiler; - compiler.plugin('done', this.doneCompiling); - } - doneCompiling() { - if (!this.watcher) { - this.watcher = browserSync.create(); - this.compiler.plugin('compilation', () => this.watcher.notify('Rebuilding...')); - this.start(); - } - // Optionally add logic for this.watcher.reload() + compiler.plugin('done', () => { + if (!this.watcher) { + this.watcher = browserSync.create(); + compiler.plugin('compilation', () => this.watcher.notify('Rebuilding...')); + this.start(); + } + // Optionally add logic for this.watcher.reload() + }); } start() { const watcherConfig = mergeWithConcat({