在路径前面加一个 !代表忽略
上方的代码可以这样修改
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/'))
})