Electron livereload - PublicVar/electron-wiki GitHub Wiki

To have the livereload with electron you can use Gulp and the package electron-connect

Install Gulp(follow the instructions on their website).

Then install the electron-connect package :

npm install electron-connect --save-dev
'use strict';

var gulp = require('gulp');
var electron = require('electron-connect').server.create();

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

  // Start browser process
  electron.start();

  // Restart browser process
  gulp.watch('app.js', electron.restart);

  // Reload renderer process
  gulp.watch(['**/*.js', '**/*.html'], electron.reload);
});

DO NOT FORGET to add the listenning client in your script to reload the page.

<html>
<body>
<!-- build:remove -->
<!-- Connect to server process -->
<script>require('electron-connect').client.create()</script> 
<!-- end:build -->
</body>
</html>
⚠️ **GitHub.com Fallback** ⚠️