【发布时间】: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}'
]
}
},
其他人看到了吗?我需要告诉凝视只看特定的文件和文件夹吗?
【问题讨论】: