I can't get the ignore option of gulp.src working:
'use strict';
var gulp = require('gulp');
var debug = require('gulp-debug');
var config = {
src: 'app/**/*.js',
test: 'app/**/*.test.js'
}
gulp.task('default', function() {
return gulp.
src(config.src, {ignore: config.test}).
pipe(debug({title: 'debug'}));
});
Output:
[01:33:38] Using gulpfile ~/Projects/gulp-src/gulpfile.js
[01:33:38] Starting 'default'...
[01:33:38] debug app/src.js
[01:33:38] debug app/src.test.js
[01:33:38] debug 2 items
[01:33:38] Finished 'default' after 19 ms
According to gulp api documentation, the option object is passed to node-glob, which has documented ignore option so why my code does not work as expected? Am I misunderstanding something? I would really like to use ignore option in favour of "!whatever/**" pattern.