Glob negotiation, exclusion of all JS files

I am a new user for gulp.js. I would like to move all my non javascript files to the build directory. Now I have the following:

//Test copy gulp.task('test-copy', function() { gulp.src(['myProject/src/**/*.!(js|map|src)']) .pipe(gulp.dest('myProject/build')); }); //Results for various files myProject/css/style.css //Copied - GOOD myProject/html/index.html //Copied - GOOD myProject/js/foo.js //Not Copied - GOOD myProject/js/bar.min.js //Copied - BAD! myProject/js/jquery-2.0.3.min.js //Copied - BAD! myProject/js/jquery-2.0.3.min.map //Copied - BAD! 

As you can see, it corresponds only to the first point in the line of the file path, and not the last, as we would like. How to change the glob search bar to behave as we would like?

+49
pattern-matching gulp glob
May 9 '14 at 5:36
source share
1 answer

Try this ball template:

 myProject/src/**/!(*.js|*.map|*.src) 
+88
May 9 '14 at 6:49
source share



All Articles