Skip to content
This repository has been archived by the owner on Jan 11, 2023. It is now read-only.

Allow disabling live reload #683

Merged
merged 1 commit into from
May 21, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 12 additions & 8 deletions src/api/dev.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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?
Expand Down Expand Up @@ -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'
});
Expand Down