Gulp-sass won't compile to CSS

I cannot get grunt-sass to compile to .css. Saw a load of other similar posts and used suggestions but nothing seems to work.

I can get other plugins to work fine (like 'del' to remove stuff shown here) so my environment seems to be fine and I can get the usual vanilla sass compile / watch to work fine.

Here's my settings just in case:

OSX Maverics 10.9.5

$ ruby -v
ruby 2.0.0p481 (2014-05-08 revision 45883) [universal.x86_64-darwin13]

$ sass -v
Sass 3.4.9 (Selective Steve)

$ npm -v
2.1.12

$ brew -v
Homebrew 0.9.5

      

Here's the project directory structure:

    ├── index.html
    ├── scss
    │    └── base.scss
    │          ├── _partial1.scss
    │          └── _partial2.scss
    ├── assets
    │      └── css
    │           └── Nothing yet!
    ├── deltest
    │    └── save.txt
    ├── gulpfile.js
    └── node_modules
         └── etc ...

      

Here's my gulpfile.js:

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

gulp.task('gsas', function() {
    gulp.src('./scss/base.scss')
        .pipe(sass({ includePaths : ['./scss/'] }))
        .pipe(gulp.dest('./assets/css'))
});

del(['!deltest/save.txt', 'deltest/delete.txt'], function (err, deletedFiles) {
    console.log('Files deleted:', deletedFiles.join(', '));
});

gulp.task('default', function() {
    console.log('AAAAAAAAAAAAAAAARGH!');
});

      

Can anyone see what is wrong here?


UPDATED - with the same task not working in Windows box:

Here's the gulpfile.js from the test window and I'm not even @importing any partial (the dir structure is exactly the same as shown in the task setup I pulled straight from the actual plugin example):

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

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

del(['delete/delete.txt', '!delete/save.txt'], function (err, deletedFiles) {
    console.log('Files deleted:', deletedFiles.join(', '));
});

gulp.task('default', function () {
    console.log("Made it!");
});

      

In this example, I run the del task again, but gulp-sass fails and this is really puzzling.

+1


source to share


1 answer


If you want the task to sass

run when run gulp

from the command line, add it as a task dependency default

:



gulp.task('default', ['sass'], function() {
  //other stuff
});

      

+4


source







All Articles