I am new to using gulp and have everything properly installed. When I run gulp in the terminal, it shows CLI version 2.3.0 and Local version 4.0.2.
However, when I make changes to my SCSS file, nothing seems to happen despite gulp running without errors in the terminal.
[13:34:16] Starting 'compile_scss'...
[13:34:16] Starting 'compile_scss'...
[13:34:16] Finished 'compile_scss' after 12 ms
[13:34:16] Starting 'detect_change_scss'...
[13:34:16] Finished 'detect_change_scss' after 16 ms
[13:34:16] Finished 'compile_scss' after 32 ms*
This is the code I have:
'use strict';
var gulp = require('gulp');
var sass = require('gulp-sass');
var minifyCSS = require('gulp-clean-css');
var uglify = require('gulp-uglify');
var renamed = require('gulp-rename');
var changed = require('gulp-changed');
var SCSS_SRC = './src/Assets/scss/**/*.scss';
var SCSS_DEST = './src/Assets/css';
function compile_scss (done) {
gulp.src(SCSS_SRC)
.pipe(sass().on('error', sass.logError))
.pipe(minifyCSS())
.pipe(renamed({ suffix: '.min' }))
.pipe(changed(SCSS_DEST))
.pipe(gulp.dest(SCSS_DEST));
done();
}
function detect_change_scss (done) {
gulp.watch(SCSS_SRC)
done();
}
gulp.task("compile_scss", gulp.series(compile_scss, detect_change_scss, ));