我正努力让肝脏在gulp.js工作。我的浏览器里有肝脏的扩展。这是我的gulpfile.js。有人能看到任何问题吗。我已经尝试了许多变体,并观看了许多视频和教程。我在经营营地,这是wordpress的安装
var gulp = require('gulp'),
livereload = require('gulp-livereload');
lr = require('tiny-lr');
server = lr();
gulp.task('styles', function() {
return gulp.src('style.css')
.pipe(livereload(server))
.pipe(gulp.dest('./'))
});
// Watch
gulp.task('watch', function() {
// // Listen on port 35729
server.listen(35729, function (err) {
if (err) {
return console.log(err)
};
// Watch .scss files
gulp.watch('style.css', ['styles']);
});
});
// Default task
gulp.task('default', ['styles', 'watch']);。。。。
编辑:对于任何感兴趣的人来说,我最终得到了Ghidello以下回答的帮助:
var gulp = require('gulp'),
livereload = require('gulp-livereload');
gulp.task('styles', function() {
return gulp.src('style.css')
.pipe(livereload())
});
// Watch
gulp.task('watch', function() {
livereload.listen();
gulp.watch('style.css', ['styles']);
});
// Default task
gulp.task('default', ['styles', 'watch']);发布于 2014-11-18 08:29:27
吞咽肝胆是微型lr包的包装器,所以您不需要同时使用它们。默认情况下,它使用的端口与您使用的端口相同,因此,相应地,对于它的文档页,您可以完全消除微小-lr,并将您的手表步骤更改为如下所示:
gulp.task('watch', function() {
livereload.listen();
gulp.watch('build/**', ['less']);
});https://stackoverflow.com/questions/26987415
复制相似问题