I am using gulp with bower and a number of other scripts with the following directory structure:
.
|- bower_components
|---- various_packages
|- js
|---- functions.js (my custom javascript)
|---- test_example_vendor_item.js
My gulp is using main-bower-files to grab the bowser files, and then concatenates my other js files.
The main problem is that within the js folder itself, I need functions.js
to be concatenated after test_example_vendor_item.js
.
Apart from simply renaming functions.js
to zzz_functions.js
, or all the other files to zzz_vendor.example.js
, is there a way to ensure that functions.js
is concatenated last?
I'm trying to use gulp-order to no avail, evidently as the initial wildcard will accept all in its original order:
gulp.task('js', function() {
var jsFiles = ['js/*'];
gulp.src(plugins.mainBowerFiles().concat(jsFiles))
.pipe(plugins.filter('*.js'))
.pipe(plugins.order([
'*',
'functions.js'
]))
.pipe(plugins.concat('main.js'))
.pipe(plugins.uglify())
.pipe(gulp.dest(dest + 'js'))
});