Advertisement
Guest User

Untitled

a guest
Jun 26th, 2019
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.89 KB | None | 0 0
  1. const gulp = require('gulp');
  2. const stylus = require('gulp-stylus');
  3. const pug = require('gulp-pug');
  4. const imagemin = require('gulp-imagemin');
  5. const connect = require('gulp-connect');
  6.  
  7. gulp.task('pug', function(){
  8. gulp.src('./src/*pug')
  9. .pipe(pug())
  10. .pipe(gulp.dest('./out'))
  11. .pipe(connect.reload())
  12. })
  13.  
  14. gulp.task('stylus', function(){
  15. gulp.src('./src/assets/styles/*.styl')
  16. .pipe(stylus())
  17. .pipe(gulp.dest('./out/assets/styles/'))
  18. .pipe(connect.reload())
  19. })
  20.  
  21. gulp.task('imagemin', function(){
  22. gulp.src('src/assets/images/*')
  23. .pipe(imagemin())
  24. .pipe(gulp.dest('out/assets/images/'))
  25. })
  26.  
  27. gulp.task('serve', function(){
  28. connect.server({
  29. root: './out',
  30. livereload: true
  31. })
  32. })
  33.  
  34. /*gulp.task('watch', function(){
  35. gulp.watch(['./src/*pug'],['pug'])
  36. gulp.watch(['./src/assets/styles/*styl'], ['stylus'])
  37. })
  38.  
  39. gulp.task('server', ['serve', 'watch'])
  40. gulp.task('build', ['pug', 'stylus'])*/
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement