问题描述
在我的大文件中,我有一个任务,它将所有内容写入 dist
文件夹。现在我正在尝试编写另一个任务,清除 dist
除供应商包之外中的所有内容。这是我到目前为止:
gulp.task('clean',function(){
return gulp .src(['./ dist','!./ dist / scripts / vendor.js'])
.pipe($。clean());
});
当我运行它时,它会一并删除 dist
。什么是排除一个文件的正确方法?
注意:我也尝试使用 如果有人知道任何有用的文档,那么这些文档将会非常有用:) In my gulpfile I have a task which builds and writes everything to a When I run this it deletes Note: I've also tried using This Github issue led me in the right direction. The pattern I wanted was If anyone knows of any good globbing docs that would be super helpful :) 这篇关于gulp - 排除文件无效的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! gulp-ignore
和 gulp-filter
具有相同的结果。 这个Github问题让我朝着正确的方向前进。我想要的模式是
['dist / *,'!dist / scripts {,/ vendor.js}'] $ c
dist
folder. Now I'm trying to write another task that cleans out everything in dist
except for my vendor bundle. This is what I have so far:gulp.task('clean', function () {
return gulp.src(['./dist', '!./dist/scripts/vendor.js'])
.pipe($.clean());
});
dist
altogether. What's the right way to exclude just one file?gulp-ignore
and gulp-filter
with the same results.['dist/*, '!dist/scripts{,/vendor.js}']
.