如何使用gulp清除所有目录和文件,但保留custom-scripts目录和该目录中的所有js文件?
"devDependencies": {
"gulp": "^3.9.0",
"gulp-bower": "0.0.10",
"rimraf": "2.2.8",
"gulp-concat": "2.5.2",
"gulp-uglify": "1.2.0",
"gulp-connect": "2.2.0",
"gulp-clean": "0.3.1"
}
这个任务会删除custom-scripts文件夹中的文件。
gulp.task('clean', function () {
return gulp.src(['./Scripts/lib', '!./Scripts/lib/custom-scripts', '!./Scripts/lib/custom-scripts/*.js'], { read: false })
.pipe(clean());
})