Skip to content

Instantly share code, notes, and snippets.

@mkoller
Created August 16, 2016 14:30
Show Gist options
  • Save mkoller/cbdc06b13775e169ccf03d2ece550872 to your computer and use it in GitHub Desktop.
Save mkoller/cbdc06b13775e169ccf03d2ece550872 to your computer and use it in GitHub Desktop.
// Convert sass to css
gulp.task('sass', function(){
return gulp.src('sass/**/*.scss') // this globs all .scss files found in folder/subfolders
// Initializes sourcemaps
.pipe(sourcemaps.init()) // this produces a sourcemaps at the bottom of our .css file for browser debugging
.pipe(sass({
errLogToConsole: true // this will log sass console errors in the termninal
}))
// Writes sourcemaps into the CSS file
.pipe(sourcemaps.write())
.pipe(gulp.dest('css'))
.pipe(browserSync.reload({
stream: true // this will reload browserync everytime we modify a .scss file
}))
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment