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'));
});
749 questions
0
votes
1 answer

Why getting error when installing gulp-sass on app directory?

I have installed global instance of gulp and worked fine: npm install -g gulp npm install -g gulp-sass But when I try to install in the app directory npm install gulp-sass I´m getting several errors, starting with gyp WARN install got an error,…
vpego
  • 145
  • 1
  • 1
  • 8
0
votes
1 answer

Gulp-sass with different paths

I have this project in Symfony src ProjectName AdminBundle Resources public css style1.css style2.ccs sass style1.scss style2.scss AdvertiserBundler .. …
Luntegg
  • 2,496
  • 3
  • 16
  • 31
0
votes
1 answer

Can't get a GULP-SASS and GULP-IMAGEMIN to work properly

Half an year a go I was using this gulpfile.js (shown below) and it worked flawlessly. Now, on windows 8.1 64bit I can't get it to properly work since hours. I'm using LiveReload in Firefox to see the changes in RealTime and Growl to get the…
BlooDev
  • 31
  • 4
0
votes
1 answer

How to organize SASS files with Gulp?

I have the following Gulpfile.js: http://pastebin.com/khEF08GC When generating the "sass" task, the Gulp creates .css files for each of .scss, I would like it to generate one file based only on the file "style.scss" which is where the @import. But…
0
votes
1 answer

bangular: Error: `libsass` bindings not found. Try reinstalling `node-sass`?

I'm getting this error while doing gulp build task after installing "bangular" project (yo bangular). Error: libsass bindings not found. Try reinstalling node-sass?
Venkat Papana
  • 4,757
  • 13
  • 52
  • 74
0
votes
1 answer

`libsass` bindings not found after node 4 upgrade

I have just upgraded nodejs from version 0.12.7 to 4.0.0 (on Windows 10). After that, when I try to run gulp-sass (which then runs node-sass) to compile SCSS files, I get this error: Error: `libsass` bindings not found in…
Klas Mellbourn
  • 42,571
  • 24
  • 140
  • 158
0
votes
1 answer

Error with gulp-sass

I get the following error when trying to run 'gulp serve': [14:14:52] Plumber found unhandled error: Error in plugin 'gulp-sass' Message: @import directives are not allowed inside mixins and functions Details: fileName:…
VSO
  • 11,546
  • 25
  • 99
  • 187
0
votes
2 answers

Gulp sass copies empty scss files to destination folder

I have a task: gulp.task('compile_scss, function() { return gulp.src('/admin_app/scss/*.scss') .pipe(sass()) .pipe(dest('/admin_app/css/')) }); When I am adding new empty ".scss" file to '/admin_app/scss/' and…
Alexandr Lazarev
  • 12,554
  • 4
  • 38
  • 47
0
votes
1 answer

laravel elixer gulp ...resources\assets\sass\app.scss <-- Not Found

I tried many times searched all over but not solved i hav updated npm , gulp version `$ gulp [06:53:53] Using gulpfile d:\xampp\htdocs\l5\gulpfile.js [06:53:53] Starting 'default'... enter code here[06:53:53] Starting 'sass'... Fetching Sass…
0
votes
1 answer

browser-sync css injection not working for cache-busted css files

I am using gulp-rev to cache-bust my compiled scss files. This means the css injections works only when I don't change anything in my css file. If I change anything, gulp-rev will give the file a different name and browserSync won't know to inject…
Marcel
  • 13
  • 3
0
votes
1 answer

Gulp : gulp-sass and gulp-css in default task one after the other

I'm having a problem with my comiled sass files not being picked for the minification with gulp-css in one command. My gulpfile.js file is as follow: var gulp = require('gulp'), uglify = require('gulp-uglify'), concat =…
Sebastian Sulinski
  • 5,815
  • 7
  • 39
  • 61
0
votes
1 answer

Gulp Sass - no errors to console

I have the following code in my glup.js file var gulp = require('gulp'); var sass = require('gulp-sass'); var sourcemaps = require('gulp-sourcemaps'); gulp.task('default', function() { gulp.src('./stylesheets/*.{scss,sass}') …
user3270454
0
votes
1 answer

Gulp + Sass + Del - Random behaviour

I don't understand why this simple script behaves differently depending on the del plugin setup. When I launch gulp sass I just want to clean the public/css dir and "compile" the css from sass. So far so good: gulp.task('clean-css',…
codependent
  • 23,193
  • 31
  • 166
  • 308
0
votes
2 answers

Gulp Sass Compile Issue

My Gulp SCSS Compiler below works fine with single files, and when including files into a single output e.g. styles.scss & _base.scss which would output styles.css. However if I was two output files e.g. styles.css & base.css upon making the scss…
Jake
  • 1
0
votes
0 answers

Should you manually add a css file in a gulp project?

I have tried so many times to get skeleton.css in the index.html for my gulp-angular project but still can't find a way to. I used bower install to install skeleton-css and it added it into its respective folder in the bower-component folder I have…
ipalibowhyte
  • 1,553
  • 2
  • 22
  • 34