watch.js 984 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. import gulp from 'gulp';
  2. import config from '../config';
  3. // WATCH TASKS
  4. // ------------------
  5. // watches for changes, recompiles & injects html + assets
  6. gulp.task('watch:styles', () => {
  7. gulp.watch(`${config.styles.source}/**/*.scss`, gulp.series('styles'));
  8. });
  9. gulp.task('watch:scripts', () => {
  10. gulp.watch(`${config.scripts.source}/**/*.js`, gulp.series('scripts'));
  11. });
  12. gulp.task('watch:images', () => {
  13. gulp.watch(`${config.images.source}/**/*`, gulp.series('images'));
  14. });
  15. gulp.task('watch:vendor', () => {
  16. gulp.watch(`${config.vendor.source}/**/*`, gulp.series('vendor:styles'));
  17. });
  18. gulp.task('watch:fonts', () => {
  19. gulp.watch(`${config.fonts.source}/**/*`, gulp.series('fonts'));
  20. });
  21. gulp.task('watch:misc', () => {
  22. gulp.watch(
  23. ['config.js'],
  24. gulp.series('styles', 'scripts')
  25. );
  26. });
  27. gulp.task(
  28. 'watch',
  29. gulp.parallel(
  30. 'watch:styles',
  31. 'watch:scripts',
  32. 'watch:images',
  33. 'watch:vendor',
  34. 'watch:fonts',
  35. 'watch:misc'
  36. )
  37. );