我已经用gulp-imagemin和clean任务设置了copyfonts任务的配置,然后当我运行gulpbuild时它运行正常,没有任何错误,但是首先运行构建任务而不是清理任务
我该如何设置清除优先的配置,而其他优先的配置
这是我的grunt.js文件,
del = require('del'),
imagemin = require('gulp-imagemin');
gulp.task('clean', function() {
return del(['dist']);
});
gulp.task('copyfonts', function(done) {
gulp.src('node_modules/font-awesome/fonts/**/*.{ttf, woff, eog, svg}*')
.pipe(gulp.dest('./dist/fonts'));
done();
});
gulp.task('imagemin', function (done) {
return gulp.src('img/*.{png,jpg,gif}')
.pipe(imagemin({ optimizationLevel: 3, progressive: true, interlaced: true }))
.pipe(gulp.dest('./dist/img'));
done();
});
gulp.task('build', gulp.series('clean', 'copyfonts', 'imagemin'));
如何设置构建任务