Gulp Speedup

Our gulp build task was taking a really long time. After a bit of investigation the problem was found to be minification / uglifying of files that were already minified (in this case jquery-1.11.1.min.js and others)

return gulp.src([sourceDir + ‘/*.js’])
.pipe(uglify(uglifyopts))
.pipe(gulp.dest(destDir));

We introduced the ! exclude option to skip over the already minified files.
TIP: Make sure to add a gulp task to copy those minified files to your destination

return gulp.src([sourceDir + ‘/*.js’,’!/*.min.js’])
.pipe(uglify(uglifyopts))
.pipe(gulp.dest(destDir));

Originally published at www.nexusconcepts.com.

One clap, two clap, three clap, forty?

By clapping more or less, you can signal to us which stories really stand out.