In Visual Studio 2015, I am tracking the changes done on my TS files so that I can copy the generated JS files and output them to my wwwroot directory. However, whenever I do a change on a single TS file, all of them are built and outputted to the wwwroot folder. What should i change here so that only new JS files are copied to wwwroot?
I use gulp-watch to track the file changes and gulp-newer to filter the new files.
gulp.task('min:site:js', function () {
return gulp
.src('Contents/Scripts/**/*.js', { relative: true })
.pipe(newer('wwwroot/js/'))
.pipe(gulp.dest('wwwroot/js/'))
.pipe(uglify())
.pipe(rename({ extname: '.min.js' }))
.pipe(gulp.dest('wwwroot/js/'));
});
gulp.task('watch:ts', function () {
gulp.watch('Contents/Scripts/**/*.ts', ['min:site:js']);
});