Reputation: 22924
I have the glob:
'app/scripts/page-*/js/*.js'
How can I get gulp to sort the following 2 files in this order:
page-user.js
page-user-create.js
I need page-xxx.js to always go first. I tried gulp-natural-sort
using both ascending and descending order but I still get the same result:
page-user-create.js
page-user.js
Upvotes: 0
Views: 104
Reputation: 30564
You can try gulp-order
instead:
.pipe(order([
'page-*([^-]).js',
'page-*-*.js'
]))
This should sort all files with a single -
in their file name before those files with two -
in their file name.
Upvotes: 2