【问题标题】:gaze breaking chrome browser in node-webkit app在 node-webkit 应用程序中凝视破坏 chrome 浏览器
【发布时间】:2014-01-24 16:02:24
【问题描述】:

这有点奇怪,但是我正在使用node-webkit构建一个应用程序,不幸的是更新嵌套文件后live-reload不起作用,所以解决方案是使用gaze。

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

当我的页面中有凝视脚本时,该应用程序运行良好并在更改时正确重新加载,但是当我转到谷歌浏览器并导航到一个页面时,它只是挂起。如果我关闭 node-webkit 应用程序,Google Chrome 页面将立即加载。

我正在使用浏览器开始凝视

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

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

在我的 grunt 文件中,我有

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}'
    ]
  }
},

其他人看到了吗?我需要告诉凝视只看特定的文件和文件夹吗?

【问题讨论】:

    标签: google-chrome node-webkit


    【解决方案1】:

    我删除了 Gaze,现在我在 node-webkit 应用程序上点击了重新加载。它重新加载比使用 Gaze 更快,当然不会导致 webkit 出现问题。

    【讨论】:

      猜你喜欢
      • 2014-12-16
      • 2020-02-26
      • 2013-10-10
      • 2011-01-30
      • 2011-09-29
      • 2015-06-08
      • 2015-01-08
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多