Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

223
Vistas
Multiple file extensions within the same directory using Gulp

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

over 4 years ago · Santiago Trujillo
2 Respuestas
Responde la pregunta

0

Take the spaces away

return gulp.src('./images/*.{png,gif,jpg}')
over 4 years ago · Santiago Trujillo Denunciar

0

This glob pattern also worked for me:

return gulp.src('./images/*.+(jpg|jpeg|gif|png)')

Note: Notice the + sign, it doesn't work without it.

Found on minimatch documentation.

over 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda