We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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
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
<!-- inject:js --> <script src="app.js"></script> <script src="controllers/add.js"></script> <script src="controllers/main.js"></script> <script src="filters/fromNow.js"></script> <script src="services/show.js"></script> <script src="vendor/angular-cookies.js"></script> <script src="vendor/angular-messages.js"></script> <script src="vendor/angular-resource.js"></script> <script src="vendor/angular-route.js"></script> <script src="vendor/angular-strap.js"></script> <script src="vendor/angular-strap.tpl.js"></script> <script src="vendor/angular.min.js"></script> <script src="vendor/moment.min.js"></script> <!-- endinject -->
and here the folders
and the console errors
so what am I missing?
The text was updated successfully, but these errors were encountered:
You shouldn't use read: false This way the files can't be well sorted and angular library is not injected before your module.
read: false
Note that <script src="vendor/angular.min.js"></script> should be the first to get it working.
<script src="vendor/angular.min.js"></script>
Sorry, something went wrong.
No branches or pull requests
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
the files are sorting like this
and here the folders
and the console errors
so what am I missing?
The text was updated successfully, but these errors were encountered: