Reload only when live reload is enabled

This commit is contained in:
Cristian Lorsson
2019-05-10 15:08:32 -03:00
parent 7aa3e90f87
commit 1fc169e7b8

View File

@@ -206,15 +206,19 @@ class Watcher extends EventEmitter {
}); });
} }
} }
), )
fs.watch(`${src}/template.html`, () => {
this.dev_server.send({
action: 'reload'
});
})
); );
if (this.live) {
this.filewatchers.push(
fs.watch(`${src}/template.html`, () => {
this.dev_server.send({
action: 'reload'
});
})
);
}
let deferred = new Deferred(); let deferred = new Deferred();
// TODO watch the configs themselves? // TODO watch the configs themselves?
@@ -252,7 +256,7 @@ class Watcher extends EventEmitter {
this.dev_server.send({ this.dev_server.send({
status: 'completed' status: 'completed'
}); });
} else { } else if (this.live) {
this.dev_server.send({ this.dev_server.send({
action: 'reload' action: 'reload'
}); });