var gulp = require('gulp');
var less = require('gulp-less');
var LessPluginAutoPrefix = require('less-plugin-autoprefix');
var autoprefix = new LessPluginAutoPrefix({
browsers: ["last 5 versions"],
cascade: true
});
var plumber = require('gulp-plumber');
gulp.src('./main.less')
.pipe(plumber())
.pipe(less({
plugins: [autoprefix]
}))
.pipe(gulp.dest('./dest/'));
参考如下代码:
通过
gulp-plumber
插件来忽略less
编译错误