sindresorhus / gulp-filter

Filter files in a `vinyl` stream
MIT License
315 stars 37 forks source link

gulp-filter is not letting any files pass. #71

Closed mnbroatch closed 7 years ago

mnbroatch commented 8 years ago

Hi, I'm new to the plugin but this definitely seems like a bug.

gulp.task('js', function(cb){ const jsFiles = ['./client/js//.js']; pump([
gulp.src(jsFiles), filter('
.js'), concat('main.js'), babel({ presets:['es2015'] }).on('error', gutil.log), uglify(), gulp.dest(dest + 'js') ], cb ); });

The problem is that no files are passing through the filter. When I take the filter out, my .js files are processed correctly.

Martinsos commented 8 years ago

@mnbroatch: I also had similar problem, and this seems to be connected to issue in minimatch, which propagates to gulp-filter.

In my case, filepaths contained a dot, and that was the reason they were filtered out (because that is what gulp-filter does by default). So try using filter as filter('*.js', {dot: true}) and see if that helps.

akullpp commented 7 years ago

Fixed by using the option dot: true

sindresorhus commented 7 years ago

Support questions are better asked on Stack Overflow: http://stackoverflow.com/questions/tagged/gulp Paste in the link to the question here so others can follow ;)