我已经得到了我Gulpfile
的编译sass
,并且只是“live-reload
远离倾销codekit
”。我正在努力让这种风格注入工作。我正在尝试进行设置:https ://github.com/vohof/gulp-livereload
当我在终端中运行 gulp 时,它似乎编译了 sass,但它没有注入样式。我究竟做错了什么?我在 chrome + 以下节点模块中安装了 livereload 扩展:
"devDependencies": {
"gulp": "~3.5.0",
"gulp-sass": "~0.6.0"
},
"dependencies": {
"gulp-livereload": "~0.2.0",
"tiny-lr": "0.0.5"
}
我的 gulpfile 看起来像这样:
var gulp = require('gulp');
//plugins
var sass = require('gulp-sass'),
lr = require('tiny-lr'),
livereload = require('gulp-livereload'),
server = lr();
gulp.task('sass', function () {
gulp.src('./scss/*.scss')
.pipe(sass())
.pipe(gulp.dest('./'))
.pipe(livereload(server));
});
// Rerun tasks when a file changes
gulp.task('watch', function () {
server.listen(35729, function (err) {
if (err) return console.log(err);
gulp.watch('scss/**/*.scss', ['sass']);
});
});
// The default task (called when you run 'gulp' from cli)
// "sass" compiles the sass to css
// "watch" looks for filechanges, and runs tasks accordingly
gulp.task('default', ['sass', 'watch']);
任何帮助深表感谢。谢谢!