After including .pipe(angularFilesort())
in my gulp script, the task runs wiredep but never proceeds to the default task. It just stops after executing wiredep. However, if I remove .pipe(angularFilesort())
, the script works perfectly fine. Can someone help me identify what the issue might be?
var gulp = require('gulp');
var browserSync = require('browser-sync');
var config = require('./gulp.config')();
var $ = require('gulp-load-plugins')({lazy: true});
var angularFilesort = require('gulp-angular-filesort');
function startBrowserSync() {
if (browserSync.active) {
console.log("already running");
return;
}
var options = {
server: {
baseDir: './'
},
files: [config.js]
}
browserSync.init(options);
}
gulp.task('default', ['wiredep'], function () {
startBrowserSync();
gulp.watch(config.js, browserSync.reload);
gulp.watch(config.html, browserSync.reload);
});
gulp.task('wiredep', function () {
var options = config.getWiredepDefaultOptions();
var wiredep = require('wiredep').stream;
return gulp
.src(config.index)
.pipe(wiredep(options))
.pipe($.inject(
gulp.src(['./src/**/*.js']).pipe(angularFilesort())
))
.pipe(gulp.dest('./'));
});