1

According to this it's possible to compile susy install from Ruby with Gulp. But is it possible to use gulp-sass instead of gulp-compass or gulp-ruby-sass because of performance and deprecation ? Actually I use this in my gulpfile.js:

gulpfile

var gulp = require('gulp');

// Include plugins
var plugins = require('gulp-load-plugins')();

// Variables de chemins
var source = './sass/**/*.scss'; // dossier de travail
var destination = './css/'; // dossier à livrer   

gulp.task('sasscompil', function () {
  return gulp.src(source)
  .pipe(plugins.sass({
      outputStyle: 'compressed',
      includePaths: ['/home/webmaster/vendor/bundle/gems/susy-2.2.2/sass']
  }).on('error', sasscompil.logError))
  .pipe(plugins.csscomb())
  .pipe(plugins.cssbeautify({indent: '  '}))
  .pipe(plugins.autoprefixer())
  .pipe(gulp.dest(destination + ''));
});

But the error log doesn't work because sasscompil isn't define. Then I need to give the path for all ex-compass includes like susy, sassy-button,etc.. is it possible to give a global path for gems ? other thing, do I install gulp plugins despite of using gulp-load-plugins ? because gulp doesn't find plugins if I don't do that.

Thanks

Community
  • 1
  • 1
webmaster pf
  • 389
  • 1
  • 5
  • 23
  • 1
    try changing `sasscompil` to `plugins.sass.logError` - can leave an answer below. (we're passing the error back to `node-sass` which is used by `gulp-sass` to output the error) [ref](https://github.com/dlmanning/gulp-sass#options) – Denis Tsoi Apr 25 '17 at 09:19
  • did the above work? – Denis Tsoi Apr 25 '17 at 09:38
  • yes ,changing to ``plugins.sass.logError`` give me ``Error in plugin 'sass' Message: sass/application.scss Error: File to import not found or unreadable: sassy-buttons. Parent style sheet: /var/www/drupal-6/sites/all/themes/starter-susy2-nc-d6/sass/application.scss on line 33 of sass/application.scss `` – webmaster pf Apr 25 '17 at 09:40
  • now, we need to look after others points : gems path and gulp plugins – webmaster pf Apr 25 '17 at 09:42
  • you have an error with importing `/var/www/drupal-6/sites/all/themes/starter-susy2-nc-d6/sass/‌​application.scss` to `sass/application.scss` I'm going to submit the answer as it solved the issue/question the import error is related to the scss file and not the `gulp-task` – Denis Tsoi Apr 25 '17 at 09:42
  • I don't think so, the error is from I don't actually give the path to the concerned gems like sassy-buttons, it works for susy. – webmaster pf Apr 25 '17 at 09:44
  • Let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/142584/discussion-between-denis-tsoi-and-webmaster-pf). – Denis Tsoi Apr 25 '17 at 09:44

1 Answers1

1

You need to change sasscompil.logError to plugins.sass.logError

such that

gulpfile.js

gulp.task('sasscompil', function () {
  return gulp.src(source)
  .pipe(plugins.sass({
      outputStyle: 'compressed',
      includePaths: ['/home/webmaster/vendor/bundle/gems/susy-2.2.2/sass']
  }).on('error', plugins.sass.logError))
...
});

gulp-sass doc:

Pass in options just like you would for node-sass; they will be passed along just as if you were using node-sass. Except for the data option which is used by gulp-sass internally. Using the file option is also unsupported and results in undefined behaviour that may change without notice.

example

gulp.task('sass', function () {
 return gulp.src('./sass/**/*.scss')
   .pipe(sass({outputStyle: 'compressed'}).on('error', sass.logError))
   .pipe(gulp.dest('./css'));
});
Denis Tsoi
  • 9,428
  • 8
  • 37
  • 56