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
624
votes
38 answers

How to fix "ReferenceError: primordials is not defined" in Node.js

I have installed Node.js modules by 'npm install', and then I tried to do gulp sass-watch in a command prompt. After that, I got the below response. [18:18:32] Requiring external module babel-register fs.js:27 const { Math, Object, Reflect } =…
Ramesh
  • 6,403
  • 3
  • 15
  • 13
152
votes
22 answers

Node Sass does not yet support your current environment: Linux 64-bit with false

Getting this error on Arch Linux with node-sass. I'm using it with gulp-sass. Node Sass does not yet support your current environment: Linux 64-bit with false Versions $ gulp -v [19:43:15] CLI version 3.9.1 [19:43:15] Local version 3.9.1 $ npm…
Jitendra Vyas
  • 134,556
  • 218
  • 544
  • 822
101
votes
5 answers

Task Runner Explorer can't load tasks

I'm using VS2015 and Gulp. I open the Task Runner Explorer and hit refresh, and this shows up in the log: Failed to run "C:\Projects\Test\Gulpfile.js"... cmd.exe /c gulp --tasks-simple Error: `libsass` bindings not found in…
Josh M.
  • 23,573
  • 23
  • 96
  • 160
93
votes
3 answers

How to compile or convert sass / scss to css with node-sass (no Ruby)?

I was struggling with setting up libsass as it wasn't as straight-forward as the Ruby based transpiler. Could someone explain how to: install libsass? use it from command line? use it with task runners like gulp and grunt? I have little experience…
Thoran
  • 7,228
  • 5
  • 35
  • 48
58
votes
11 answers

Gulpjs combine two tasks into a single task

I currently have two tasks, that both compile sass files. I would still like to concat the two directories into separate files but it seems that it would be more maintainable if I could simply create a 'sass' task that would be responsible for all…
Noah Goodrich
  • 23,504
  • 12
  • 61
  • 95
51
votes
4 answers

Have sass-lint ignore a certain line?

I'm using sass-lint with Gulp. How can I disable warnings for a particular style in my sass from the lint console output? I've found a similar question but I'm using sass-lint, not scss-lint: Having scss-lint ignore a particular line This is the…
Evanss
  • 17,152
  • 66
  • 217
  • 397
49
votes
7 answers

Node Sass does not yet support your current environment: Windows 64-bit with Unsupported runtime (88)

I have tried to install gulp-sass latest version with npm i gulp-sass --save-dev in the begining I got a lot of errors but later solved them. But whenever I try to run gulp I got this error: Error: Node Sass does not yet support your current…
DINA TAKLIT
  • 4,946
  • 7
  • 42
  • 50
49
votes
9 answers

cannot find module "lodash"

Today I tried to learn more about Google Web Starter Kit so I followed these instructions and after a lot of fight and problem I just tried to start a local server (the first task we’ll look at is: $ gulp serve.) and received this…
Bosko Skrbina
  • 513
  • 1
  • 4
  • 5
41
votes
1 answer

Underscore in partial Sass file

Is it necessary to have a .scss partial file start with an underscore? The documentation states that a partial should start with an underscore, because the file would otherwise compile to a CSS file. However I've noticed gulp-sass compiles files…
Squrler
  • 3,144
  • 8
  • 35
  • 59
35
votes
4 answers

Gulp condition inside pipe

How can I do a condition inside Gulp pipe to output to a different destination. g.task('sass', function() { return g.src(sources.sass).pipe(changed(output.css)).pipe(sass({ style: 'compressed', sourcemap: true })).pipe(function() { …
max li
  • 2,197
  • 3
  • 26
  • 43
31
votes
7 answers

cannot read property 'apply' of undefined gulp

I am trying to use the ng-factory generator to scaffold a new project to build an angularjs component. After the project has been created with the yo ng-factory command, I tried to run it using the gulp serve task but found the following…
atul kale
  • 311
  • 1
  • 3
  • 4
30
votes
4 answers

Gulp.js event stream merge order

I am trying to merge css and scss files into a main.css file that goes in my build directory. Its working, but not in the right order. The style attributes from the scss files need to be in the bottom of the main.css file so they overrule the…
Jabba Da Hoot
  • 796
  • 2
  • 6
  • 15
29
votes
1 answer

Gulp doesn't work

I installed gulp on my machine, but when i try to compile my project i have this error: Error: Cannot find module 'del' at Function.Module._resolveFilename (module.js:338:15) at Function.Module._load (module.js:280:25) at Module.require…
user3519727
  • 331
  • 2
  • 4
  • 10
22
votes
5 answers

Cannot find module '../lib/completion' Inspite of installing Completion

I am getting this error Cannot find module '../lib/completion' however I have installed completion and completion.js is present in the lib file. ->gulp compile module.js:327 throw err; ^ Error: Cannot find module '../lib/completion' at…
Utpal - Ur Best Pal
  • 4,095
  • 2
  • 14
  • 27
20
votes
3 answers

gulp sass source map

I need help adding source map to SASS compiler in the same CSS output folder. Till now, I got to install gulp-sourcemaps module within gulpfile.js but couldn't know success to bind sourcemaps.write as gulp.task. Any help is much appreciated :) var…
user1556571
1
2 3
47 48