klei / klei/gulp-angular-filesort

Sort files on gulp-inject index task

Open
#47 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
131
Forks
47
PR merge metrics
No merged PRs in 30d

Description

I am trying to sort my files since I am getting an Angular error because of the sort of the files.

This is my Gulp file

``` javascript
var gulp = require('gulp');
var angularFilesort = require('gulp-angular-filesort');
var naturalSort = require('gulp-natural-sort');
var inject = require('gulp-inject');

gulp.task('index', function () {
var target = gulp.src('./public/index.html');
var sources = gulp.src(
['./**/*.js', './**/*.css'],
{
read: false,
cwd: __dirname + "/public/",
}
).pipe(angularFilesort());

return target.pipe(inject(sources, { addRootSlash: false }))
.pipe(gulp.dest('./public'));
});
```

the files are sorting like this

``` html















```

and here the folders

[![enter image description here](http://i.stack.imgur.com/vThl1.png)](http://i.stack.imgur.com/vThl1.png)

and the console errors

[![enter image description here](http://i.stack.imgur.com/aKBvk.png)](http://i.stack.imgur.com/aKBvk.png)

so what am I missing?

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reproducing the `index` Gulp task using `public/index.html` and the JavaScript sources shown in the issue, then inspect how `angularFilesort()` determines their order. Done means identifying why the generated injection order causes the reported Angular errors and either correcting the behavior or documenting the required configuration.

Written by the indexing model from the issue text.

Assessment

Tech stack
angularjs, javascript
Domain
build-system, tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
28/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.