Gulp watch sass makes the terminal hang - is that the point?

So, I just lured my hands with Gulp. I have never worked with Grunt, but it seems that Gulp is a new big thing. Everything seems to be working fine. I successfully compiled SCSS into CSS with the following gulpfile.js:

// Include gulp
var gulp = require('gulp'); 

// Include Our Plugins
var sass = require('gulp-sass');
var rename = require('gulp-rename');


// Compile Our Sass
gulp.task('sass', function() {
    return gulp.src('./scss/*.scss')
        .pipe(sass())
        .pipe(gulp.dest('./css'));
});

// Rerun the task when a file changes
gulp.task('watch', function () {
  gulp.watch('scss/**/*.scss', ['sass']);
});

// Default Task
gulp.task('default', ['sass', 'watch']);

Thing: when I run Gulp by default in a terminal, it runs a script, but never ends it. I assume that in order for Gulp to watch my files, it must continue to work.

Standby time with this:

[gulp] Running 'sass'...
[gulp] Finished 'sass' in 8.47 ms

If this is the case - how can I stop it from starting without closing and reopening the terminal? Sorry if this is easy, but I don’t know when it comes to the Terminal.

+4
source share
1

gulp , .

README : gulp -watch

: Ctrl + C .

watch . - , sass :

gulp.watch('./scss/**/*.scss', ['sass']);
+7

Source: https://habr.com/ru/post/1523935/


All Articles