Skip to content

Commit 643f73b

Browse files
Announcementxzyfer
authored andcommittedMay 23, 2018
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.
1 parent 0b3c7e7 commit 643f73b

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed
 

‎README.md

+10
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,16 @@ gulp.task('sass', function () {
7070
});
7171
```
7272

73+
Or this for synchronous code:
74+
75+
```javascript
76+
gulp.task('sass', function () {
77+
return gulp.src('./sass/**/*.scss')
78+
.pipe(sass.sync({outputStyle: 'compressed'}).on('error', sass.logError))
79+
.pipe(gulp.dest('./css'));
80+
});
81+
```
82+
7383
## Source Maps
7484

7585
`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.

0 commit comments

Comments
 (0)
Please sign in to comment.