N
N
neytan2021-06-30 11:04:58
gulp.js
neytan, 2021-06-30 11:04:58

Gulp watch: how to run in terminal?

Hello. Tell me what command to run gulp watch in the terminal (when driving in gulp watch, it writes an error)?
Here is the content of gulpfile.js

const gulp = require('gulp');
const sass = require('gulp-sass')(require('sass'));
const sourcemaps = require('gulp-sourcemaps');
const watch = require('gulp-watch');

function buildStyles() {
    return gulp.src('./scss/**/*.scss')
        .pipe(sourcemaps.init())
        .pipe(sass().on('error', sass.logError))
        .pipe(sourcemaps.write('./'))
        .pipe(gulp.dest('./css'));
};

exports.buildStyles = buildStyles;
exports.watch = function () {
    gulp.watch('./scss/**/*.scss', ['scss']);
};

Compilation of scss is launched via the gulp buildStyles command, but I can't run gulp watch (.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question