Created
March 21, 2019 14:54
-
-
Save marypieroszkiewicz/8bf5b14e2817daac4c41ebc92b40c1ee to your computer and use it in GitHub Desktop.
This file contains hidden or 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', ['sass']) | |
}); | |
gulp.task('default', ['sass', 'watch']); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment