Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

207
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!