So I have a gulpfile.js setup.
In an images folder I have a few images, some are pngs, some jpgs and some gifs.
I want to target all the pngs, jpgs and gifs in the images folder.
I could use **/* to target everything in the folder, but I don't want to, I want it to be specific to the file types.
I could also do this and specify each file type individually:
return gulp.src('./images/*.jpg', './images/*.png', './images/*.gif')
But it's a lot of repeating yourself and it seems that there should be an easier way.
I'm looking for something like this:
return gulp.src('./images/*.{png, gif, jpg}')
But alas, the above doesn't work (or at least it only works for the first file type in the list)
Anyone know how to do this?
Thanks
Take the spaces away
return gulp.src('./images/*.{png,gif,jpg}')
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With