T
T
teremok10002016-05-14 15:41:44
gulp.js
teremok1000, 2016-05-14 15:41:44

How to reconfigure task gulp-ruby-sass to gulp-sass?

Hello, please help me to correctly reconfigure the task that was written under gulp-ruby-sass and now you need to use gulp-sass :

gulp.task('sass', function() {

    var processors = [
        autoprefixer({browsers: ['last 10 versions'], cascade: false}),
        mqpacker({
            sort: function (a, b) {
                a = a.replace(/\D/g,'');
                b = b.replace(/\D/g,'');
                return b-a;
                // replace this with a-b for Mobile First approach
            }
        })
    ];

    return sass(config.src.sass+'*.sass', {
        sourcemap: true,
        style: 'compact',
        emitCompileError: true
    })
    .on('error', notify.onError({
        title: 'Sass Error!',
        message: '<%= error.message %>'
    }))
    .pipe(postcss(processors))
    .pipe(sourcemaps.write('./'))
    .pipe(gulp.dest(config.dest.css));
});

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry Belyaev, 2016-05-14
@bingo347

gulp.task('sass', function() {

    var processors = [
        autoprefixer({browsers: ['last 10 versions'], cascade: false}),
        mqpacker({
            sort: function (a, b) {
                a = a.replace(/\D/g,'');
                b = b.replace(/\D/g,'');
                return b-a;
                // replace this with a-b for Mobile First approach
            }
        })
    ];

    gulp.src(config.src.sass+'*.sass')
        .pipe(sass({outputStyle: 'compact', sourcemap: true}).on('error', notify.onError({
            title: 'Sass Error!',
            message: '<%= error.message %>'
        })))
        .pipe(postcss(processors))
        .pipe(sourcemaps.write('./'))
        .pipe(gulp.dest(config.dest.css));
});

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question