Questions tagged [gulp-sass]

a gulp plugin for compilation of Sass to CSS.

gulp-sass is a gulp plugin for compilation of Sass files to CSS files.

Basic example of usage:

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

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

The plugin can also be used with gulp-sourcemaps:

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

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

gulp-sass accepts node-sass compatible options, e.g.:

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

gulp.task('sass', function () {
  gulp.src('./sass/**/*.scss')
    .pipe(sass({ outputStyle: 'compressed' }))
    .pipe(gulp.dest('./css'));
});
718 questions
0
votes
1 answer

How to source files in parent directories

I'm trying to combine multiple scss files into one, similar to Gulp: How to create a task that compiles multiple SASS files?; however one of my files is above my gulpfile: /project_root/ fe/ common/ …
Jakob Jingleheimer
  • 29,050
  • 22
  • 73
  • 121
0
votes
1 answer

Generate sourcemap for each partial

I'm using the gulp-sass and would like for each partials he manages a sourcemap , I can do this using the less but did not see a way to do this with sass. _partial.scss ( within it have to have a mapfile ). _partial2.scss ( this also ).
Edmo Lima
  • 123
  • 10
0
votes
1 answer

Gulp not running gulp-sass

I installed a new distro (Elementary OS 0.3 Freya 64 bits) on my PC and setting up my workflow I'm having a problem running the gulp-sass package. When I run the gulp command it return the error: $ gulp [10:26:06] Using file…
0
votes
1 answer

Gulp Bower error on default task with Libsass & Susy

When I run the gulp task (default) for the first time, the sass task gives an error on a Bower package. More specifically on Susy. The error: Plumber found unhandled error: Error in plugin 'gulp-sass' Message: file to import not found…
Jrn
  • 1,035
  • 1
  • 12
  • 25
0
votes
0 answers

Critical CSS cache embedded scripts and mis behaves with Gulp/ npm

A quick little breakdown: I'm setting up a boilerplate. At the moment I have Gulp converting scss to css via gulp-sass and then after I use critical to get the above the fold CSS & embed it in the head via . Initially it worked the problem came…
frontsideup
  • 2,679
  • 1
  • 19
  • 22
0
votes
1 answer

drupal 7 theming + gulp + sass + browserSync no css injection

I'm able to get browserSync.reload({stream:true}) to css inject into a wordpress theme. When I try the same gulpfile.js in a Drupal 7 theme a hard reset works, browserSync.reload(), but css injection does nothing,…
Bradley
  • 136
  • 1
  • 11
0
votes
1 answer

gulp-sass giving no result

I'm trying to use gulp and gulp-sass to compile bower components in my project. I am using Windows 8. The problem Im having is that gulp-sass seems not to be working. Or at least not giving me the result of the compilation. The weird thing about it…
fbrthld
  • 66
  • 1
  • 8
0
votes
1 answer

What does "./" mean in Gulp.js?

I've been reading up on Gulp. In the following code you'll notice that in the gulp.src and the gulp.dest that the path starts with ./ gulp.src('./scss/*.scss') .pipe(sass({ includePaths: ['bower_components/foundation/scss'] })) …
JeremyE
  • 1,186
  • 4
  • 15
  • 33
0
votes
1 answer

Gulp "watch" is not running the sub task "sass" on file change

I am using Gulp for watch and sass complier. When I start "watch" first time then "sass" complier runs and its create the css files as per given path. However when I change the .scss files then it doesn't call "sass" complier again. Following is is…
joy
  • 3,499
  • 6
  • 35
  • 72
0
votes
1 answer

If gulp is watching conditional

How can I apply a condition argument based on if gulp is watching or not? gulp.task('styles', function(){ return gulp.src('sass/**/*.scss') .pipe(sass()) if (isWatching) { // gulp.dest to the .tmp directory if "gulp watch" …
0
votes
0 answers

Gulp.src isn't returning any files, or something?

I was working on a new project at home last week and now I am in the office I am having no luck with Gulp. There are no errors when I run Gulp but it isn't creating any files, I tried using Gulp-tap to see if anything was getting piped but its not.…
Jono20201
  • 3,093
  • 2
  • 18
  • 32
0
votes
1 answer

Unable to load ionic css file(s) compiled from sass (.scss) using gulp-sass

I'm trying to move an application over from a Grunt build to Gulp. My Gulp build generates a ionic.css file which I attempt to load with a link tag in my index.html. I get an error in my chrome inspector that the file is not found at that path even…
Brad W
  • 2,468
  • 2
  • 15
  • 26
0
votes
1 answer

Gulp sass task running slowly

I have this Gulp task in my 'gulpfile.js' which utilises the gulp-ruby-sass plugin. When I run it, it tasks at least 8 seconds to compile. The equivalent script in Grunt can take less than 1 second so I am confused as to what is causing the…
jshjohnson
  • 157
  • 3
  • 13
0
votes
1 answer

Gulp Ruby Sass - RegexpError: failed to allocate memory :/\n.*/

I have installed Gulp on my project and was working perfectly. Today when I run gulp build the project it is giving error: gulp plugin ruby sass. The following message appears: Error in plugin 36mgulp-ruby-sass-39m RegexpError: failed to…
0
votes
2 answers

error compiling susy2 with gulp

I have a very simple gulp based test environment using only sass and the susy2 gem - no compass because compass is no longer a dependency of susy 2 The error i'm getting is ...sass/susy/language/susy/settings:8:error: error reading values after…
rakitin
  • 1,569
  • 5
  • 17
  • 40
1 2 3
47
48