gulpfile.js 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. var gulp=require('gulp'), browserSync=require('browser-sync').create(), less=require('gulp-less'), autoprefixer=require('gulp-autoprefixer');
  2. // Static Server + watching scss/html files
  3. gulp.task('serve', ['less'], function() {
  4. browserSync.init({
  5. server: "../funeral-services"
  6. });
  7. gulp.watch("less/*.less", ['less']);
  8. gulp.watch("*.html").on('change', browserSync.reload);
  9. gulp.watch("documents/*.html").on('change', browserSync.reload);
  10. gulp.watch("js/*.js").on('change', browserSync.reload);
  11. });
  12. // gulp.task('less', function() {
  13. // gulp.src('less/*.less')
  14. // // gulp.src('../scss/*.scss')
  15. // .pipe(less({outputStyle: 'expanded'}).on('error', less.logError))
  16. // .pipe(gulp.dest('css/'))
  17. // .pipe(browserSync.stream());
  18. // });
  19. //gulp.task('default', ['serve']);
  20. gulp.task('default', ['serve'],() =>
  21. gulp.src('css/main.css')
  22. .pipe(autoprefixer({
  23. browsers: ['last 2 version', 'safari 5', 'ie 10', 'opera 12.1', 'ios 7', 'android 4'],
  24. cascade: false,
  25. }))
  26. .pipe(gulp.dest('css/autoprefixer'))
  27. );
  28. var less = require('gulp-less');
  29. var path = require('path');
  30. gulp.task('less', function () {
  31. return gulp.src('less/main.less')
  32. .pipe(less({
  33. paths: [ path.join(__dirname, 'less', 'includes') ]
  34. }))
  35. .pipe(gulp.dest('./css'));
  36. });