There is also a way to do this using the gulp-webserver (The reason I ran across this post), and does not require the gulp-livereload. Ignore the react-generator which is a separate task that does my react transforms. Needless to say, this task starts the webserver, watches for changes, runs the generator, and then reloads on those changes.
var gulp = require('gulp'),
electron = require('electron-prebuilt'),
webserver = require('gulp-webserver'),
gulp.task(
'run',
['react-generator'], // Secondary task, not needed for live-reloading
function () {
gulp.watch('./app/react/*.jsx', ['react-generator']);
gulp.src('app')
.pipe(webserver({
port: 8123,
fallback: "index.html",
host: "localhost",
livereload: {
enable: true,
filter: function(fileName) {
if (fileName.match(/.map$/)) {
return false;
} else {
return true;
}
}
},
}));
});
As noted in the previous answer, you will need to add the following to your index file, or it will act like it doesn't work for Electron, but does for browsers.
<script src="http://localhost:35729/livereload.js"></script>