Skip to content

Commit

Permalink
Merge pull request #408 from Keats/master
Browse files Browse the repository at this point in the history
Return streams + handle errors everytime in README
  • Loading branch information
xzyfer committed Dec 22, 2015
2 parents 52fba69 + 9438bf2 commit cc1bca6
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 11 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ node_js:
- "0.10"
- node
- iojs
sudo: false
26 changes: 15 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ var gulp = require('gulp');
var sass = require('gulp-sass');

gulp.task('sass', function () {
gulp.src('./sass/**/*.scss')
return gulp.src('./sass/**/*.scss')
.pipe(sass().on('error', sass.logError))
.pipe(gulp.dest('./css'));
});
Expand All @@ -40,7 +40,7 @@ var gulp = require('gulp');
var sass = require('gulp-sass');

gulp.task('sass', function () {
gulp.src('./sass/**/*.scss')
return gulp.src('./sass/**/*.scss')
.pipe(sass.sync().on('error', sass.logError))
.pipe(gulp.dest('./css'));
});
Expand All @@ -55,10 +55,11 @@ gulp.task('sass:watch', function () {
Pass in options just like you would for [`node-sass`](https://github.com/sass/node-sass#options); they will be passed along just as if you were using `node-sass`.

For example:
```js
gulp.task('sass', function () {
gulp.src('./sass/**/*.scss')
.pipe(sass({outputStyle: 'compressed'}))

```javascript
gulp.task('sass', function () {
return gulp.src('./sass/**/*.scss')
.pipe(sass({outputStyle: 'compressed'}).on('error', sass.logError))
.pipe(gulp.dest('./css'));
});
```
Expand All @@ -70,23 +71,26 @@ For example:
```javascript
var sourcemaps = require('gulp-sourcemaps');

gulp.src('./scss/*.scss')
gulp.task('sass', function () {
return gulp.src('./sass/**/*.scss')
.pipe(sourcemaps.init())
.pipe(sass())
.pipe(sass().on('error', sass.logError))
.pipe(sourcemaps.write())
.pipe(gulp.dest('./css'));
});
```

By default, [gulp-sourcemaps](https://github.com/floridoo/gulp-sourcemaps) writes the source maps inline in the compiled CSS files. To write them to a separate file, specify a path relative to the `gulp.dest()` destination in the `sourcemaps.write()` function.

```javascript
var sourcemaps = require('gulp-sourcemaps');

gulp.src('./scss/*.scss')
gulp.task('sass', function () {
return gulp.src('./sass/**/*.scss')
.pipe(sourcemaps.init())
.pipe(sass())
.pipe(sass().on('error', sass.logError))
.pipe(sourcemaps.write('./maps'))
.pipe(gulp.dest('./css'));
});
```

# Issues
Expand Down

0 comments on commit cc1bca6

Please sign in to comment.