gulp.task('css', function () {
gulp.src('custom_css/sass/style.scss')
.pipe(sass({
style: 'compressed'
}))
.pipe(gulp.dest('./public/css/'));
});
gulp.task('watch', function() {
gulp.watch('custom_css/sass/style.scss', ['css']);
});
gulp.task('default', ['css','watch']);
this is my gulp script code. when I run gulp
in the terminal it start watching for changes, auto compile sass file, but it stop watching if I closed the terminal window. I have also used gulp &
to run it in background but not working so what is the proper way to auto compile it every time when I am make chages in the saas file.
I have make it run in the background with nohup gulp &
and it's working perfectly. Is it right way to do it?