Advertisement
Guest User

Untitled

a guest
Feb 6th, 2016
44
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.11 KB | None | 0 0
  1. 'use strict';
  2.  
  3. var gulp = require('gulp'),
  4. browserSync = require('browser-sync').create(),
  5. sass = require('gulp-sass'),
  6. scsslint = require('gulp-scss-lint'),
  7. plumber = require('gulp-plumber'),
  8. notify = require("gulp-notify"),
  9. sourcemaps = require('gulp-sourcemaps');
  10.  
  11. // Development Tasks
  12.  
  13. gulp.task('serve', ['scss-lint', 'sass'], function() {
  14. browserSync.init({
  15. server: "./.tmp"
  16. });
  17.  
  18. gulp.watch("./scss/**/*.scss", ['scss-lint', 'sass']);
  19. gulp.watch("./.tmp/*.html").on('change', browserSync.reload);
  20. });
  21.  
  22. gulp.task('sass', function() {
  23. return gulp.src("./scss/style.scss")
  24. .pipe(plumber({errorHandler: notify.onError("Error: <%= error.message %>")}))
  25. .pipe(sourcemaps.init())
  26. .pipe(sass())
  27. .pipe(sourcemaps.write())
  28. .pipe(gulp.dest("./.tmp/css"))
  29. .pipe(browserSync.stream());
  30. });
  31.  
  32. gulp.task('scss-lint', function(){
  33. return gulp.src('./scss/**/*.scss')
  34. .pipe(plumber({errorHandler: notify.onError("Error: <%= error.message %>")}))
  35. .pipe(scsslint({
  36. filePipeOutput: 'scssReport.json'
  37. }))
  38. .pipe(gulp.dest('./.tmp/reports'));
  39. })
  40.  
  41. gulp.task('default', ['serve']);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement