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

208
Vistas
Gulp minify every .js in a unique .min.js file (Nodejs)

I have a doubt how to minify every file in the /src into a unique one .min.js First I know how I can do it in a particular folder for instance: "/src/services/*js" this away it will minify all files from services into a one. But What if I intend to minify all files from all folders into a unique one? My tasks are now minify from folder to folder, exemple:

   gulp.task('services', () => {
        return gulp.src('.src/services/*.js')
            .pipe(plumber())
            .pipe(uglify())
            .pipe(concat(`services.js`))
            .pipe(rename({ suffix: '.min.js' }))
            .pipe(gulp.dest('./dist/services'));
    });

Another questions:

1- How can I fix required folders, if all files and all folders are into one, require folders should be removed, how can I do it?

const fileUtil = require('./src/utils/fileUtil');

2- Should I have functions which has the same name, to not have a conflic when all files get together, actually now in services and repositories there is some functions with same name

I know it's many question to a single topic but I'm new gulp user and I have too many questions to do the best practices

about 4 years ago · Juan Pablo Isaza
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