Questions tagged [gulp-ruby-sass]

a gulp plugin for compilation of Sass to CSS using Ruby Sass gem.

gulp-ruby-sass is a gulp plugin to compile Sass files (.scss) to CSS files using Ruby Sass gem.

Basic usage example:

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

gulp.task('sass', function() {
    return sass('source/') 
    .on('error', function (err) {
      console.error('Error!', err.message);
   })
    .pipe(gulp.dest('result'));
});

Sophisticated usage example (used with gulp-sourcemaps and gulp-livereload):

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

// Compile public Sass task
gulp.task('sass_site', function () {
  return sass('public/_sources/sass/main.scss', { style: 'compressed' })
    .pipe(sourcemaps.init())
    .pipe(sourcemaps.write('./maps'))
    .pipe(gulp.dest('public/_assets/css'))
    .pipe(livereload());
});

// The watch task
gulp.task('watch', function () {
  livereload.listen();

  // Use this for logging in terminal
  gulp.watch('public/_sources/sass/**/*.scss', ['sass_site']).on('change', function (file) {
    livereload.changed(file.path);
    gutil.log(gutil.colors.yellow('Public CSS changed' + ' (' + file.path + ')'));
  });

  // Or this if you don't need logging
  // gulp.watch('public/_sources/sass/**/*.scss', ['sass_site']);
});

To run the example issue gulp sass_site or gulp watch command in terminal.

49 questions
1
vote
0 answers

Gulp Sass Watch Run only changed and dependencies

I am trying to figure out how to watch SCSS files for changes and then run task (gulp-ruby-sass) only for those that changed(added,removed) and their dependencies (@import). My watch task code is: gulp.task('sass-watch', function(){ …
Lukáš Řádek
  • 1,273
  • 1
  • 11
  • 23
1
vote
0 answers

Using gulp-ruby-sass to import parcels into source file during compile time

My goal is to use one scss file with n number of asset partials to create n number of css stylesheets while using gulp-ruby-sass. Here is an example of my directory structure: - project_folder gulpfile.js - css _asset.scss …
1
vote
1 answer

Sass-gulp error importing whole directory

I'll start by saying I've looked for hours and haven't found any solution that works for me. I'm trying to get away from Compass and switch to Sass for my company's website, and I'm running into the issue that Sass doesn't recognize my directories;…
1
vote
0 answers

gulp is not processing sass to correct directory

Ok so everything used to work just fine on a diff computer and after switching I ended up having to install everything again. Now I read through the tutorial to install gulp and it actually works with javascript files but for some odd reason my…
Andres
  • 2,013
  • 6
  • 42
  • 67
1
vote
1 answer

The gulp plugin gulp-ruby-sass version 2.0.4 does not compile

The gulp plugin gulp-ruby-sass doesn't work "gulp-ruby-sass": "^2.0.4" for the compiler at the same time it does work with its own old version "gulp-ruby-sass": "^0.7.1" var gulp = require('gulp'), sass = require('gulp-ruby-sass'), notify =…
Mo.
  • 26,306
  • 36
  • 159
  • 225
1
vote
0 answers

Error while converting Bootstrap-Sass with gulp, but other sass files work

Trying to convert bootstrap-sass to css using gulp. Here's my gulpfile var gulp = require('gulp'); var sass = require('gulp-ruby-sass'); // Concatenate Sass gulp.task('sass', function() { var sassFiles =…
Devin
  • 465
  • 1
  • 6
  • 15
1
vote
1 answer

Does gulp-autoprefixer work with gulp-compass?

If I compile the scss with gulp-ruby-sass, gulp-autoprefixer works, but if a compile de scss with gulp-compass autoprefixer doen't work. This is the code: gulp = require('gulp'), sass = require('gulp-ruby-sass'), livereload =…
1
vote
2 answers

Incorrect filename using gulp-sourcemaps

I'm using gulp-sourcemaps in my project to process my SASS and JavaScript. My gulpfile.js is correctly generating .map files, though Chrome is showing the wrong filenames in Developer Tools and Console. At the moment, I'm unsure where the issue…
Mike Kaperys
  • 160
  • 1
  • 1
  • 9
1
vote
0 answers

Gulp SASS, autoprefixer, minify and sourcemaps generate huge file

I'm experiencing strange behaviour using this Gulp configuration to minify my SASS files generating sourcemaps. 'use strict'; var PATH = { SRC_DIR: 'src/', SRC: { IMG: 'img/', INDEX: 'index.html', JS: { …
1
vote
0 answers

Gulp-Ruby-SASS erroring even though CSS file is empty

I'm currently trying to update our boilerplate for web apps and its build tools. I'm getting this error currently: events.js:85 throw er; // Unhandled 'error' event ^ Error: Broken @import declaration of "branding", Broken @import…
ProblemsOfSumit
  • 19,543
  • 9
  • 50
  • 61
1
vote
2 answers

gulp-ruby-sass errors out with undefined is not a function

I am trying to run the sass task in my config with gulp-ruby-sass,this is the error that I get(the error will be followed by my config and code): [04:57:11] TypeError: undefined is not a function at DestroyableTransform.Readable.pipe [as _pipe]…
vamsiampolu
  • 6,328
  • 19
  • 82
  • 183
0
votes
0 answers

How to replace selectors in scss file while compilatioon

This is my scss file - https://github.com/syncfusion/ej2-javascript-ui-controls/blob/master/controls/buttons/styles/button/_layout.scss#L3 In above i have used {#{&} but i want to replace that with empty string while compiling to css [ based on…
Kumaresan Sd
  • 1,399
  • 4
  • 16
  • 34
0
votes
1 answer

gulp ruby sass proplem

While I was working on gulp this error suddenly appeared and all tools work ok until I do save in sass file. [16:54:10] Starting 'sass'... [16:54:10] Finished 'sass' after 44 ms [16:54:11] C:/Ruby24-x64/lib/ruby/2.4.0/win32/registry.rb:72:in `find':…
0
votes
2 answers

gulp sass is not working showing error

showing me this error don't know how to resolve it. my gulpfile.js code is as follow var gulp = require('gulp'), uglify = require('gulp-uglify'), sass = require('gulp-ruby-sass'); gulp.task('default', function(){ gulp.src('js/*.js') …
Owais p
  • 109
  • 1
  • 4
  • 12
0
votes
1 answer

Error in using gulp + foundation (sass version)

I want to use gulp + Foundation 6 + browserify. when run gulp in cli i have this error in terminal write ./scss.css/foundation.css path.js:7 throw new TypeError('Path must be a string. Received ' + inspect(path)); ^ TypeError: Path must be a…
MEHRYĀR.S
  • 77
  • 2
  • 13