exclude = function (condition, minimatchOptions){
return through.obj(function (file, enc, callback) {
if (!gulpmatch(file, condition, minimatchOptions)) {
this.push(file);
}
return callback();
});
}...
var jshint = require('gulp-jshint');
var condition = './gulpfile.js';
gulp.task('task', function() {
gulp.src('./**/*.js')
.pipe(jshint())
.pipe(gulpIgnore.exclude(condition))
.pipe(uglify())
.pipe(gulp.dest('./dist/'));
});
```
Run JSHint on everything, remove gulpfile from the stream, then uglify and write everything else.
...include = function (condition, minimatchOptions){
return through.obj(function (file, enc, callback) {
if (gulpmatch(file, condition, minimatchOptions)) {
this.push(file);
}
return callback();
});
}...
var jshint = require('gulp-jshint');
var condition = './public/**.js';
gulp.task('task', function() {
gulp.src('./**/*.js')
.pipe(jshint())
.pipe(gulpIgnore.include(condition))
.pipe(uglify())
.pipe(gulp.dest('./dist/'));
});
```
Run JSHint on everything, filter to include only files from in the public folder, then uglify and write them.
...