Live reload for an electron application


I want to use a combination of VScode + Gulp + Electron to build an application. A nice feature of the development workflow would be to add an live reload task to my Gulp watch task, to reload the Electron application on every change.

Any Idea how to achieve this?

Your help is highly appreciated.


I am not sure of a livereload way to do this, but I achieve a similar beahaviour by listening on keydown even of document and if it’s an F5, or CTRL + ALT + R, then do location.reload()


Thanks for your answer, in addition I found a nicer solution to do it. Please have a look at this post and also the comments.


<!-- gulp.js-->
var gulp = require('gulp');
var run = require('gulp-run');
var livereload = require('gulp-livereload');

gulp.task('copy-html', function() {
    // Perform minification tasks, etc here

gulp.task('run', function() {
  return run('../dep/electron dist/ ').exec();

gulp.task('watch', function () {

gulp.task('default', ['watch', 'run']);
<!-- index.html -->
    <title>Angular 2 Quickstart</title>
    <script src="http://localhost:35729/livereload.js"></script>


Thanks for sharing! Please fix the typo in'src/**/*.*',['copy-html']);

and maybe a cleaner matching to src/**/*.html


thanks, its done.


electron-connect works like a charm:

It provides the following features:

  • start(and restart) Electron process in your Node.js script
  • reload renderer process in your Node.js script