Search code examples
sassgulp

"gulp sass" command runs but nothing happens


This is my gulpfile.js file;

'use strict';

var gulp = require('gulp');
var sass = require('gulp-sass');

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

gulp.task('sass:watch', function () {
    gulp.watch('./sass/*.scss', ['sass']);
});

You can see my folders here:

folders

I write some code in my main scss file and then run gulp sass command in the terminal. It looks like it works but nothing changes.


Solution

  • i dont think you need the './' in your src directory or destination directory, should look like this.

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