D
D
Dmitry ProZhar2015-10-20 14:06:00
JavaScript
Dmitry ProZhar, 2015-10-20 14:06:00

What is the benefit of adding the sync() function to gulp-sass?

How is the standard code different:

'use strict';
 
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'));
});
 
gulp.task('sass:watch', function () {
  gulp.watch('./sass/**/*.scss', ['sass']);
});

from
'use strict';
 
var gulp = require('gulp');
var sass = require('gulp-sass');
 
gulp.task('sass', function () {
  gulp.src('./sass/**/*.scss')
    .pipe(sass.sync().on('error', sass.logError))
    .pipe(gulp.dest('./css'));
});
 
gulp.task('sass:watch', function () {
  gulp.watch('./sass/**/*.scss', ['sass']);
});

It means that the scss files in the first version will be compiled in turn, and in the second they will be compiled in parallel / synchronously or what?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexey Ukolov, 2015-10-20
@alexey-m-ukolov

You can also compile synchronously
https://github.com/dlmanning/gulp-sass#basic-usage
and in the second they will be compiled in parallel / synchronously or what?
On the contrary, synchronously = sequentially.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question