0

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 lag.

'use strict';

var gulp = require('gulp');
var minifyCSS = require('gulp-minify-css');

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

var path = {
    src: function (path) {
        return './assets/' + path;
    },
    dist: function (path) {
        return './web/' + path;
    },
};

// Styles
gulp.task('styles', function () {
    return gulp.src(path.src('styles/**/*.scss'))
        .pipe(plugins.rubySass({sourcemap: false, style: 'expanded', quiet: true }))
        .pipe(plugins.autoprefixer('last 2 versions', '> 1%', 'ie 8'))
        .pipe(gulp.dest(path.src('styles')))
        .pipe(minifyCSS())
        .pipe(plugins.rename({suffix: '.min'}))
        .pipe(gulp.dest(path.dist('styles')))
        .pipe(plugins.size());
});
jshjohnson
  • 157
  • 4
  • 16

1 Answers1

0

I swapped out gulp-ruby-sass for gulp-sass and I can now compile in under a second. Marvellous!

jshjohnson
  • 157
  • 4
  • 16