Created
March 21, 2019 17:29
-
-
Save marypieroszkiewicz/2d4f62028e453b6acc9c2ac3ed749f4c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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