【发布时间】:2016-03-11 03:26:03
【问题描述】:
我想做的就是看:
我的项目/更少
此目录中有数百个 Less 文件。保存文件时,我只想编译保存的文件。
以下代码正确观看,但编译了所有较少的文件。开销有点太大了。
gulp.task('compileCurrentTheme', function () {
// is there a way to get the filename that is saved and pass it dynamically to gulp.src?
return gulp.src('less/**/*.less')
.pipe(less())
.pipe(gulp.dest('./css'));
});
gulp.task('watch', function(){
gulp.watch(['less/**/*.less' ], ['compileCurrentTheme']);
});
【问题讨论】:
-
你看过github.com/contra/gulp-cached吗?单独观看可能还不够。
标签: gulp gulp-watch