SHARE
TWEET

Untitled

a guest Mar 26th, 2019 72 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. const gulp = require('gulp');
  2. const sass = require('gulp-sass');
  3. const gplumber = require('gulp-plumber');
  4. const sourcemaps = require('gulp-sourcemaps');
  5.  
  6. var errorHandler = function() {
  7.     return gplumber(function(error) {
  8.         console.log(error.message);
  9.     })
  10. };
  11.  
  12. gulp.task('sass', function() {
  13.     return gulp.src('scss/*.scss')
  14.         .pipe(errorHandler())
  15.         .pipe(sourcemaps.init())
  16.         .pipe(sass.sync({outputStyle: 'expanded'}))
  17.         .pipe(sourcemaps.write())
  18.         .pipe(gulp.dest('css'))
  19. });
  20.  
  21. gulp.task('watch', function(){
  22.     return gulp.watch('scss/**/*.scss', ['sass'])
  23. });
  24.  
  25. gulp.task('default', ['sass', 'watch']);
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top