Search code examples
csssassgulp

Gulp task is not creating css file


Good morning,

My task created at gulpfile.js is following:

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

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

when I try to run gulp sass I am getting this info:

Starting 'sass'...
Finished 'sass' after 20 ms

and my css file is not creating (I have obviously created scss file before).

What may be the reason of my issue?


Solution

  • Remove the underscore from the name of scss file. Underscores are for partials. Also, / is root directory and ./ is for the current directory. Read this

    Update your Gulpfile.js:

    const gulp = require('gulp');
    const sass = require('gulp-sass');
    
    gulp.task('sass', function () {
      gulp.src('./sass/*.scss')
        .pipe(sass())
        .pipe(gulp.dest('./../assets/css'));
    });