This repository was archived by the owner on Aug 14, 2020. It is now read-only.

Description
Since your project is a very useful and convenient starter of universal application. A hot reload with Ionic Serve and Electron development is very essential. Herewith the gulpfile.js, hope you may find it useful for further automate / 'lazy' dev.
const gulp = require('gulp')
const electron = require('electron-connect').server.create()
const config = require('@ionic/app-scripts/dist/util/config')
const ionic = require('@ionic/app-scripts')
gulp.task('electron-live', function () {
// Start browser process
electron.start()
gulp.watch('src/app.js', electron.restart)
// Reload renderer process
gulp.watch([
'www/js/app.js',
'www/**/*.html',
'www/**/*.css',
'www/**/*.js'], electron.reload)
})
gulp.task('dev', function () {
ionic.watch(config.generateContext())
.then(function () {
gulp.start('electron-live')
})
.catch(function (err) {
console.log('Error starting watch: ', err)
})
})
The above code may help us to dev ionic in electron with hot reload, just run gulp dev and everything will go on.