0
gulp.task('live', function() {
// listen for changes
livereload.listen();
// watch less files in src (to start just type gulp in the src directory)
gulp.watch('public/css/**/*.less', ['src-less-to-css', 'src-less-to-css-ie8', 'src-less-to-css-ie9']);
gulp.watch('public/**/*', livereload()); // <--- this ain't working
// configure nodemon
nodemon({
// the script to run the app
script: 'app.js',
ext: 'js',
ignore: ['public/**/*']
}).on('restart', function(){
// when the app has restarted, run livereload.
gulp.src('app.js')
.pipe(livereload())
.pipe(notify('Reloading page, please wait...'));
})
});
所以我想調用livereload()方法,只要公共directoy中的文件發生更改,不管哪個文件,任何內容和所有內容。使用livereload()直接與手錶?
我希望像上面的一個簡單的解決方案。