From 643f73b64a96dd2f5008389327f59c0526e009f6 Mon Sep 17 00:00:00 2001 From: Jacob Francis Powers Date: Thu, 5 Oct 2017 10:02:44 -0500 Subject: [PATCH] Add documentation for synchronous code options It's not clearly documented how to add options to sass.sync, and this is implemented inconsistently across other code infrastructures, so it's not safe to assume whether it's `sass(options).sync()` or `sass.sync(options)` please accept the pull request if the proposed documentation is correct, or otherwise accept it anyways and provide a follow up merge as an update fix. --- README.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/README.md b/README.md index 15f2960..1e77212 100644 --- a/README.md +++ b/README.md @@ -70,6 +70,16 @@ gulp.task('sass', function () { }); ``` +Or this for synchronous code: + +```javascript +gulp.task('sass', function () { + return gulp.src('./sass/**/*.scss') + .pipe(sass.sync({outputStyle: 'compressed'}).on('error', sass.logError)) + .pipe(gulp.dest('./css')); +}); +``` + ## Source Maps `gulp-sass` can be used in tandem with [gulp-sourcemaps](https://github.com/floridoo/gulp-sourcemaps) to generate source maps for the Sass to CSS compilation. You will need to initialize [gulp-sourcemaps](https://github.com/floridoo/gulp-sourcemaps) prior to running `gulp-sass` and write the source maps after.