Gulp how to make 2 files, linking libraries in a separate file and the file common.js?

If you just combine all the js files and connect custom scripts do not work. Need to connect jikiri. But jikiri is United file libraries and there custom scripts, but it doesn't work. It should be the same that would javeri was connected first.
Now I have in the js folder, all the plugins, libraries and custom skrypty.
My task
gulp.task('js', function() {
 return gulp.src('frontend/assets/js/*.js')
.pipe(concat('all.min.js'))
.pipe(uglify())
.pipe(gulp.dest('public/js'));
});

Gulp how to make 2 files, linking libraries in a separate file and the file common.js?
July 9th 19 at 10:47
1 answer
July 9th 19 at 10:49
Solution
Maybe not quite understand your question, as it is slyly wise you asked it, but for example all the builds sent in the form of 2 files: main.js and vendor.js in principle, the same train, and with styles. What about Tusk, here's an example of my some libraries (not essential):
// ~ Compile JS ~
var jsFilter = gulpFilter('**/*.js');

// Concat vendor JS (uglify for production)
gulp.task('js:vendor', function() {
gulp.src(mainBowerFiles({
 "overrides": {
 "jquery": {
 "main": "./dist/jquery.min.js"
},

 "bootstrap": {
 "main": "./dist/js/bootstrap.min.js"
},

 "magnific-popup": {
 "main": "./dist/jquery.magnific-popup.min.js"
}
}
}))
.pipe(jsFilter)
.pipe(concat('vendor.js'))
 .pipe(gulpIf(env !== 'dev', uglify()))
 .pipe(gulp.dest(outputDir + 'js'))
});

// Concat own JS (uglify for production)
gulp.task('js', function() {
gulp.src(src.js)
.pipe(jsHint())
.pipe(jsHint.reporter('default'))
.pipe(concat('script.js'))
 .pipe(gulpIf(env !== 'dev', uglify()))
 .pipe(gulp.dest(outputDir + 'js'))
.pipe(connect.reload());
});

configuration is performed depending on production or development version

Find more questions by tags Gulp.js