Advertisement
Guest User

Untitled

a guest
Oct 2nd, 2015
197
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.97 KB | None | 0 0
  1. var gulp = require('gulp'),
  2. sass = require('gulp-sass'),
  3. jade = require('gulp-jade'),
  4. connect = require('gulp-connect');
  5.  
  6.  
  7. gulp.task('connectDev', function () {
  8. connect.server({
  9. root: ['testing/development', 'tmp'],
  10. port: 8000,
  11. livereload: true
  12. });
  13. });
  14.  
  15. gulp.task('connectDist', function () {
  16. connect.server({
  17. root: 'dist/development',
  18. port: 8001,
  19. livereload: true
  20. });
  21. });
  22.  
  23. gulp.task('dist-html', function () {
  24. gulp.src('dist/development/*.html')
  25. .pipe(connect.reload());
  26. });
  27. gulp.task('testing-html', function () {
  28. gulp.src('testing/development/*.html')
  29. .pipe(connect.reload());
  30. });
  31.  
  32. gulp.task('testing-sass', function(){
  33. return gulp.src('testing/src/scss/**/*.scss')
  34. .pipe(sass())
  35. .pipe(gulp.dest('testing/development/css'))
  36. .pipe(connect.reload());
  37. });
  38.  
  39. gulp.task('dist-sass', function(){
  40. return gulp.src('dist/src/scss/**/*.scss')
  41. .pipe(sass())
  42. .pipe(gulp.dest('dist/development/css'))
  43. .pipe(connect.reload());
  44. });
  45. gulp.task('dist-jade', function(){
  46. return gulp.src('dist/src/jade/**/*.jade')
  47. .pipe(jade())
  48. .pipe(gulp.dest('dist/development/'))
  49. .pipe(connect.reload());
  50. });
  51. gulp.task('testing-jade', function(){
  52. return gulp.src('testing/src/jade/**/*.jade')
  53. .pipe(jade())
  54. .pipe(gulp.dest('testing/development/'))
  55. .pipe(connect.reload());
  56. });
  57.  
  58.  
  59.  
  60.  
  61.  
  62. gulp.task('watch', function () {
  63. gulp.watch(['dist/src/jade/**/*.jade'], ['dist-jade']);
  64. gulp.watch(['dist/src/scss/**/*.scss'], ['dist-sass']);
  65. gulp.watch(['dist/development/**/*.html'], ['dist-html']);
  66.  
  67. gulp.watch(['testing/src/jade/**/*.jade'], ['testing-jade']);
  68. gulp.watch(['testing/src/scss/**/*.scss'], ['testing-sass']);
  69. gulp.watch(['testing/development/**/*.html'], ['testing-html']);
  70. });
  71. gulp.task('default', ['connectDist','connectDev', 'watch']);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement