Guest User

Untitled

a guest
Jun 25th, 2018
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.92 KB | None | 0 0
  1. var gulp = require('gulp'),
  2. minCSS = require('gulp-clean-css'),
  3. browserSync = require('browser-sync').create(),
  4. sass = require('gulp-compass');
  5.  
  6. // Static Server + watching scss/html files
  7. gulp.task('serve', ['sass'], function() {
  8. browserSync.init({
  9. server: "./app"
  10. });
  11.  
  12. gulp.watch('app/sass/*.scss', ['sass']);
  13. gulp.watch('app/*.html').on('change', browserSync.reload);
  14. });
  15.  
  16. // Compile sass into CSS & auto-inject into browsers
  17. gulp.task('sass', function() {
  18. gulp.src('app/sass/*.scss')
  19. .pipe(sass({
  20. config_file: 'app/config.rb',
  21. css: 'app/css',
  22. sass: 'app/sass',
  23. image: 'app/img'
  24. }))
  25. /*.on('error', function(error) {
  26. // Would like to catch the error here
  27. console.log(error);
  28. this.emit('end');
  29. })*/
  30. .pipe(minCSS({compatibility: 'ie8'}))
  31. .pipe(gulp.dest('app/dist/css'))
  32. .pipe(browserSync.stream());
  33. });
  34.  
  35. gulp.task('default', ['serve']);
Add Comment
Please, Sign In to add comment