Skip to content

Commit

Permalink
Use closure instead of doneCompiling() method. Fixes roots#1717
Browse files Browse the repository at this point in the history
  • Loading branch information
QWp6t committed Sep 12, 2016
1 parent ce82d1a commit c96905b
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions assets/build/webpack.plugin.browsersync.js
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand Down

0 comments on commit c96905b

Please sign in to comment.