0

This is a bit strange, but I'm building an app using node-webkit, and unfortunately live-reload does not work after updating a nested file, so the solution is to use gaze.

https://github.com/rogerwang/node-webkit/wiki/Livereload-node-webkit-on-changes

When I have the gaze script in my page, the app works fine and reloads properly on changes, but when I then go to Google Chrome, and navigate to a page, it just hangs. If I close the node-webkit app, the Google Chrome page will load instantly.

I'm starting gaze within the browser using

 var Gaze = require('gaze').Gaze;
 var gaze = new Gaze('**/*');

 gaze.on('all', function(event, filepath) {
           if (location)
             location.reload();
 });

and in my grunt file, I have

watch: {
  js: {
    files: ['<%= yeoman.app %>/scripts/{,*/}*.js','<%= yeoman.app %>/styles/{,*/}*.less'],
    tasks: ['newer:jshint:all', 'less'],
    options: {
      livereload: true
    }
  },
  jsTest: {
    files: ['test/spec/{,*/}*.js'],
    tasks: ['newer:jshint:test', 'karma']
  },
  less: {
    files: ['<%= yeoman.app %>/styles/{,*/}*.*','<%= yeoman.app %>/vendor/{,*/}*.less'],
    tasks: ['less','newer:copy:styles', 'autoprefixer'],
    options: {
      nospawn: true,
      livereload: true
    }
  },
  gruntfile: {
    files: ['Gruntfile.js']
  },
  livereload: {
    options: {
      livereload: '<%= connect.options.livereload %>'
    },
    files: [
      '<%= yeoman.app %>/{,*/}*.html',
      '<%= yeoman.app %>/styles/{,*/}*.css',
      '<%= yeoman.app %>/images/{,*/}*.{png,jpg,jpeg,gif,webp,svg}'
    ]
  }
},

Anybody else seen this? Do I need to tell gaze to only watch specific files and folders?

pedalpete
  • 21,076
  • 45
  • 128
  • 239

1 Answers1

1

I removed Gaze, and now I just hit reload on the node-webkit app. It reloads faster than using Gaze, and of course doesn't cause problems with webkit.

pedalpete
  • 21,076
  • 45
  • 128
  • 239