I am having trouble controlling the order in which my javascript files are concatenated with Gulp. I've tried gulp-order but it doesn't seem to work. I just started using Gulp, so I am sure (hoping) this is an easy solution. I did notice some SO posts on renaming the files with numbers...I do not want to do this. Thank you.
gulp.task('scripts', function () {
gulp.src('starter_app/static/backoffice/js/vendor/*.js')
.pipe(order([
'excanvas.js',
'respond.js',
'js.cookie.min.js',
'bootstrap-hover-dropdown.min.js',
'jquery.slimscroll.min.js',
'jquery.blockui.min.js',
'jquery.uniform.min.js',
'bootstrap-switch.min.js',
'app.min.js',
'dashboard.min.js',
'layout.min.js',
'quick-sidebar.min.js'
]))
.pipe(concat('scripts.js'))
.pipe(gulp.dest('starter_app/static/backoffice/js'));
});
You can do:
gulp.task('scripts', function () {
gulp.src([
'excanvas.js',
'respond.js',
'js.cookie.min.js',
'bootstrap-hover-dropdown.min.js',
'jquery.slimscroll.min.js',
'jquery.blockui.min.js',
'jquery.uniform.min.js',
'bootstrap-switch.min.js',
'app.min.js',
'dashboard.min.js',
'layout.min.js',
'quick-sidebar.min.js'
], {
cwd: 'starter_app/static/backoffice/js/vendor'
})
.pipe(concat('scripts.js'))
.pipe(gulp.dest('starter_app/static/backoffice/js'));
});