Skip to content

Commit

Permalink
Auto-update tsconfig/files using tsconfig/filesGlob before build
Browse files Browse the repository at this point in the history
  • Loading branch information
moander committed Jul 13, 2015
1 parent 51cf6e6 commit b323265
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
11 changes: 10 additions & 1 deletion generators/app/templates/_gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ var tslint = require('gulp-tslint');
var exec = require('child_process').exec;
var jasmine = require('gulp-jasmine');
var gulp = require('gulp-help')(gulp);
var tsconfig = require('gulp-tsconfig-files');

var tsFilesGlob = (function(c) {
return c.filesGlob || c.files || '**/*.ts';
Expand All @@ -14,7 +15,7 @@ gulp.task('tslint', 'Lints all TypeScript source files', function(){
.pipe(tslint.report('verbose'));
});

gulp.task('build', 'Compiles all TypeScript source files', function (cb) {
gulp.task('build', 'Compiles all TypeScript source files', ['tsconfig_files'], function (cb) {
exec('tsc', function (err, stdout, stderr) {
console.log(stdout);
console.log(stderr);
Expand All @@ -26,3 +27,11 @@ gulp.task('test', 'Runs the Jasmine test specs', ['build'], function () {
return gulp.src('test/*.js')
.pipe(jasmine());
});

gulp.task('tsconfig_files', 'Update files section in tsconfig.json', function () {
var src = require('./tsconfig.json').filesGlob;
if (typeof src !== 'undefined') {
gulp.src(src).pipe(tsconfig());
}
});

1 change: 1 addition & 0 deletions generators/app/templates/_package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
"gulp-help": "^1.6.0",
"tslint": "2.*",
"gulp-jasmine": "^2.0.1",
"gulp-tsconfig-files": "0.0.2",
"jasmine": "^2.3.1"
},
"engines": {
Expand Down

0 comments on commit b323265

Please sign in to comment.