NotKelbie NotKelbie - 4 months ago 13
Sass (Sass) Question

Converting scss to css using gulp. [Problems]

I have been trying to convert scss to css and this is my code.

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

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


I get no errors but it just dosnt do anything.

[05:12:54] Using gulpfile ~/Desktop/Project/gulpfile.js
[05:12:54] Starting 'sass'...
[05:12:54] Finished 'sass' after 13 ms


This is my scss file, not sure if thats useful to know.

.lol {
width: percentage(100/2);
}


Workspace.
Any help is appreciated!

Answer

You are missing a trailing slash in gulp.dest('app/css'), causing gulp to write to file named css in the app folder.

Instead, your sass task should read:

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