Skip to content

Commit

Permalink
Add documentation for synchronous code options
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Announcement authored and xzyfer committed May 23, 2018
1 parent 0b3c7e7 commit 643f73b
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions README.md
Expand Up @@ -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.
Expand Down

0 comments on commit 643f73b

Please sign in to comment.