Gulp gulp-angular-filesort plugin not working with ionic

I’d like to inject the bower dependencies in my index.html by using gulp-inject, main-bower-files and gulp-angular-filesort. It seems that the gulp-angular-filesort does not manage to build the tree dependency correctly.


  "name": "HelloIonic",
  "private": "true",
  "devDependencies": {
    "ionic": "driftyco/ionic-bower#1.0.0-beta.14"
  "dependencies": {
    "ngCordova": "~0.1.12-alpha",
    "restangular": "",
    "angular-local-storage": "~0.1.5",
    "ionic": "driftyco/ionic-bower#v1.0.0-beta.14",
    "ionicons": "~2.0.1"

The build/vendor folders contains all js files detected by main-bower-files plugin.

		.pipe(inject(gulp.src(['./build/vendor/**/*.js']).pipe(angularFilesort()).pipe(print()), {
			name: 'bower',
			relative: false,
			ignorePath: '/build',
			addRootSlash: false

Running the task I get that order:

[15:17:35] Starting 'vendor'...
[gulp] build/vendor/restangular.js
[gulp] build/vendor/ng-cordova.js
[gulp] build/vendor/lodash.compat.js
[gulp] build/vendor/ionic.js
[gulp] build/vendor/ionic-angular.js
[gulp] build/vendor/angular.js
[gulp] build/vendor/angular-ui-router.js
[gulp] build/vendor/angular-sanitize.js
[gulp] build/vendor/angular-local-storage.js
[gulp] build/vendor/angular-animate.js

which is reflected then in the index.html, and makes the ionic app missing some dependencies.