How to match files that start with a character in gulp filter?

326 views Asked by At

I want to filter the file (vendor.min.js and vendor.min.css) which is starting with vendor and then add revision to it. How to match the files which start with vendor? I tried to give

var filterVendor=filter(['!src/main/^vendor*js']);
var filterVendor=filter(['!src/main/vendor*js']);
var filterVendor=filter(['!src/main/[^vendor]']);

I want to filter all the files which start with vendor

var filter = require('gulp-filter');        

    var filterVendor=filter(['!src/main/^vendor*js']);

          return gulp.src ( [srcFolder + '/app/*.jsp', srcFolder + '/app/auth/*.jsp'] )
                    .pipe ( assets )
                    .pipe ( $.if ( '*.js' , $.ngAnnotate () ) )
                    .pipe(filterVendor)
                    .pipe( rev() )
                    .pipe($.useref() )
                    .pipe( assets.restore() )
                    .pipe( importFn )
                    .pipe ( gulp.dest ( distFolder ) )
                    .pipe (  $.size ( {'title': 'html'} ) );
            } );

I'm new to gulp.If anyone knows please help.Thanks in advance.

0

There are 0 answers