Skip to content

Instantly share code, notes, and snippets.

@marypieroszkiewicz
Created March 21, 2019 17:29
Show Gist options
  • Save marypieroszkiewicz/2d4f62028e453b6acc9c2ac3ed749f4c to your computer and use it in GitHub Desktop.
Save marypieroszkiewicz/2d4f62028e453b6acc9c2ac3ed749f4c to your computer and use it in GitHub Desktop.
const gulp = require('gulp');
const sass = require('gulp-sass');
const gplumber = require('gulp-plumber');
const sourcemaps = require('gulp-sourcemaps');
var errorHandler = function() {
return gplumber(function(error) {
console.log(error.message);
})
};
gulp.task('sass', function() {
return gulp.src('scss/*.scss')
.pipe(errorHandler())
.pipe(sourcemaps.init())
.pipe(sass.sync({outputStyle: 'expanded'}))
.pipe(sourcemaps.write())
.pipe(gulp.dest('css'))
});
gulp.task('watch', function() {
return gulp.watch('scss/**/*.scss', gulp.series('sass'))
});
gulp.task('default', gulp.parallel('sass', 'watch'));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment