Skip to content
This repository has been archived by the owner on Aug 14, 2020. It is now read-only.

A useful hot reload method for Big Top #3

Open
ghost opened this issue Mar 19, 2018 · 0 comments
Open

A useful hot reload method for Big Top #3

ghost opened this issue Mar 19, 2018 · 0 comments

Comments

@ghost
Copy link

ghost commented Mar 19, 2018

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.

@ghost ghost changed the title A better hot reload with ionic and electron A better hot reload method for Big Top Mar 19, 2018
@ghost ghost changed the title A better hot reload method for Big Top A useful hot reload method for Big Top Mar 19, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

0 participants