Skip to content

Sorting seems to break given different orderings on globs passed to gulp.src #30

@forty8bits

Description

@forty8bits

Following on from my post in #12, it seems that gulp-angular-filesort is breaking given different orderings of the glob patterns passed into gulp.src before piping into gulp-angular-filesort, which seems like a bug. Basically, changing from this:

gulp.src([
  'app/**/*.js',
  '!app/bower_components/**/*.js',
  '.tmp/templates.js'
]).pipe($.angularFilesort())

To this:

gulp.src([
  '.tmp/templates.js',
  'app/**/*.js',
  '!app/bower_components/**/*.js'
]).pipe($.angularFilesort())

Gives a working script order for injection. .tmp/templates.js is the file output from gulp-angular-templatecache, set to use the main app module (rather than create its own) and use an immediately invoked function expression wrapper (as is used in all of the other files). The contents of this file are completely as expected; no different from any of my own source files in structure. For some reason, when added to the end of the glob patterns, gulp-angular-filesort outputs the main module followed immediately by the templates file right at the top, whereas when inserted as the first entry in the glob patterns, the output is as expected, with the main module and it's dependencies at the end of the injected files.

This may be an issue in ng-dependencies rather than gulp-angular-filesort; I'm happy to provide more help and info given some direction.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions