gulpfile.js代码如下
var gulp = require('gulp');
var less = require('gulp-less');
var through = require('gulp-through');
var notify = require('gulp-notify');
//LESS编译任务
gulp.task('less', function () {
return gulp.src('less/*.less')
.pipe(less())
.pipe(through(function () {
this.emit("error", new Error("Something happend: Error message!"))
}))
.on("error", notify.onError("Error: <%= error.message %>"))
.pipe(gulp.dest('css'));
});
gulp.task('default', function () {
gulp.watch('less/*.less', ['less']);
});
守候你守候我
相关分类