gulp 怎么忽略文件?
-
我在做一个编译html的任务,它把 node_modules 里面的html都找出来了,怎么忽略 node_module 这文件夹呢?
gulp.task('html', function() { return gulp .src('./**/*.html') .pipe(preprocess({ context: { NODE_ENV: "production", DEBUG: true } })) // To set environment variables in-line .pipe(gulp.dest('./../dist/')) })
-
在路径前面加一个
!
代表忽略
上方的代码可以这样修改gulp.task('html', function() { return gulp .src(['./**/*.html', '!./node_modules/**/*']) .pipe(preprocess({ context: { NODE_ENV: "production", DEBUG: true } })) // To set environment variables in-line .pipe(gulp.dest('./../dist/')) })