我已经让liveReload在scss和js上工作得很好,但在html上就不行了。这是我的任务..。
var gulp = require('gulp'),
liveReload = require('gulp-livereload');
gulp.task('watchFiles', function () {
liveReload.listen();
gulp.watch('src/**/*.scss', ['compileSass']);
gulp.watch('src/**/*.html', ['watchHtmlFiles']);
gulp.watch('src/**/*.js', ['bundle-app']);
}); 我需要使用run-sequence来确保在bundling..and replaceIndex是从'src‘到'dist’的index.html的简单管道之前构建好我的模板。
var gulp = require('gulp'),
runSequence = require('run-sequence'),
liveReload = require('gulp-livereload');
gulp.task('watchHtmlFiles', function (callback) {
runSequence('templates', 'bundle-app', 'replaceIndex', callback);
}); 如果我将".pipe(liveReload())“作为捆绑包的一部分添加到捆绑应用程序和replaceIndex任务中,我会得到一个错误。但这不管用...
发布于 2015-11-17 00:04:49
这现在可以工作了,不需要额外的更改!我唯一可以归因于这种突然转变的事情是,我正在运行另一个angular项目,同时karma正在运行。当它被关闭时,html文件的实时重新加载工作正常...
https://stackoverflow.com/questions/33727420
复制相似问题