I want to concat and uglify my JS files with gulp. After that I want to conact the result with a vendor folder which includes jquery, bootstrap, ...
How can I concat the files from the vendor folder after uglify my js code?
Here is my current gulp file:
var gulp = require('gulp');
var concat = require('gulp-concat');
var uglify = require('gulp-uglify');
gulp.task('scripts', function() {
gulp.src([
'./src/resources/assets/js/**/*.js',
'!./src/resources/assets/js/vendor/**/*.js'
])
.pipe(concat('main.js'))
.pipe(uglify())
.pipe(gulp.dest('./public/js/'));
});
gulp.task('default', ['scripts'], function() {
});
if I understand your question correctly, you want to concat your js.files with the libraries, but keep a concat version of your own js ?
I would do that, you get to keep both files :
or that, you only keep one file :