I am using gulp 3.0 and using gulp-tsc & wiredep plug-ins however when I combine both the plug-in together , I am not getting expected output (typescript compling process start after wiredep task so wiredep is not including complied Java Script file in index.html) . Please find below code snippet and please let me know if any thing can be done to get expected output i.e. wiredep should wait for tsc compiler to finish his job and include compiled dependency in the index.html) .
gulp.task('compile:typescript', () => {
gulp.src(config.ts)
.pipe(typescript())
.pipe(gulp.dest(config.dest))
});
gulp.task('run', function () {
runseq('compile:typescript', 'wiredep');
});
gulp.task('wiredep', () => {
var options = config.wiredepDefaultOptions();
gulp.src(config.index)
.pipe(wiredep(options))
.pipe(gulp.dest(config.dest))
.pipe($.inject(gulp.src(config.js)))
.pipe($.inject(gulp.src(config.css)))
.pipe(gulp.dest(config.dest));
});
Even when you use run-sequence you still have to return the streams from your tasks for gulp to know when your tasks are finished:
gulp.task('compile:typescript', () => {
return gulp.src(config.ts)
//^^^^^^ don't forget this
.pipe(typescript())
.pipe(gulp.dest(config.dest))
});
gulp.task('run', function () {
runseq('compile:typescript', 'wiredep');
});
gulp.task('wiredep', () => {
var options = config.wiredepDefaultOptions();
return gulp.src(config.index)
//^^^^^^ don't forget this
.pipe(wiredep(options))
.pipe(gulp.dest(config.dest))
.pipe($.inject(gulp.src(config.js)))
.pipe($.inject(gulp.src(config.css)))
.pipe(gulp.dest(config.dest));
});