I have integrated the gulp
build with my angular
application development. Each time when a js,html,css
changes I am compiling the files as single and running the app.
in previous it was fine. when I add more js
file I am getting delayed to reload the web page by brower-sync
. But I understood each time gulp
is compiling all files are single even if that's not updated.
my question is:
- how to compile only
updated
files and run thebrower-sync
? here is my gulp code :
gulp.task('js', function() {
gulp.src(scripts)
.pipe(sourcemaps.init())
.pipe(concat('scripts.js'))
.pipe(annotate())
.pipe(uglify())
.pipe(sourcemaps.write())
.pipe(gulp.dest('./dist/js'))
.pipe(browserSync.reload({
stream: true
}));
});