Advertisement
Guest User

Untitled

a guest
Sep 17th, 2015
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. var gulp = require('gulp');
  2. var livereload = require('gulp-livereload');
  3.  
  4. gulp.slurped = false;
  5.  
  6. gulp.task('copyHTML', function(){
  7. return gulp.src('src/*.html')
  8. .pipe(gulp.dest("public"));
  9. });
  10.  
  11. gulp.task('babel', function(){
  12. return gulp.src('src/js/**/*.js')
  13. .pipe(babel())
  14. .pipe(gulp.dest('public/js/main.js'));
  15. });
  16.  
  17. gulp.task('watch', function(){
  18. livereload.listen();
  19. if(!gulp.slurped){
  20. gulp.watch('gulpfile.js', ['default']);
  21. gulp.watch('src/*.html'), ['copyHTML']);
  22. gulp.slurped = true;
  23. }
  24. });
  25.  
  26. gulp.task('default', ['watch']);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement