From 1fc169e7b81ae07f86d869210ea0fdb58afa2cfc Mon Sep 17 00:00:00 2001 From: Cristian Lorsson Date: Fri, 10 May 2019 15:08:32 -0300 Subject: [PATCH] Reload only when live reload is enabled --- src/api/dev.ts | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/src/api/dev.ts b/src/api/dev.ts index adfd73a92..78123e9f2 100644 --- a/src/api/dev.ts +++ b/src/api/dev.ts @@ -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(); // TODO watch the configs themselves? @@ -252,7 +256,7 @@ class Watcher extends EventEmitter { this.dev_server.send({ status: 'completed' }); - } else { + } else if (this.live) { this.dev_server.send({ action: 'reload' });