Skip to content

Commit b69b03d

Browse files
committed
Add watch task
1 parent 0ddbe92 commit b69b03d

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

generators/app/templates/_gulpfile.js

+15-2
Original file line numberDiff line numberDiff line change
@@ -45,17 +45,30 @@ gulp.task('gen-def', 'Generate a single .d.ts bundle containing external module
4545
});
4646

4747
gulp.task('_build', 'INTERNAL TASK - Compiles all TypeScript source files', function (cb) {
48+
exec('tsc --version', function (err, stdout, stderr) {
49+
console.log('TypeScript ', stdout);
50+
if (stderr) {
51+
console.log(stderr);
52+
}
53+
});
54+
4855
return exec('tsc', function (err, stdout, stderr) {
4956
console.log(stdout);
50-
console.log(stderr);
57+
if (stderr) {
58+
console.log(stderr);
59+
}
5160
cb(err);
5261
});
5362
});
5463

55-
//run tslint task, then run _tsconfig_files and _gen_tsrefs in parallel, then run _build
64+
//run tslint task, then run update-tsconfig and gen-def in parallel, then run _build
5665
gulp.task('build', 'Compiles all TypeScript source files and updates module references', gulpSequence('tslint', ['update-tsconfig', 'gen-def'], '_build'));
5766

5867
gulp.task('test', 'Runs the Jasmine test specs', ['build'], function () {
5968
return gulp.src('test/*.js')
6069
.pipe(jasmine());
6170
});
71+
72+
gulp.task('watch', 'Watches ts source files and runs build on change', function () {
73+
gulp.watch('src/**/*.ts', ['build']);
74+
});

0 commit comments

Comments
 (0)