copy.js 873 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. import config from '../config';
  2. import path from 'path';
  3. import gulp from 'gulp';
  4. /**
  5. * Copy font files
  6. *
  7. * @param cb: callback handler passed by gulp, signals task completion when called
  8. */
  9. export const copyFonts = (cb) => {
  10. gulp.src(
  11. path.join(
  12. config.paths.src,
  13. config.paths.fonts,
  14. '*.{woff,woff2}'
  15. )
  16. ).pipe(
  17. gulp.dest(path.join(
  18. config.paths.dest,
  19. config.paths.assets,
  20. config.paths.fonts
  21. ))
  22. );
  23. cb();
  24. };
  25. /**
  26. * Copy images
  27. *
  28. * @param cb: callback handler passed by gulp, signals task completion when called
  29. */
  30. export const copyImages = (cb) => {
  31. gulp.src(
  32. path.join(
  33. config.paths.src,
  34. config.paths.images,
  35. '*.{png,gif,jpg,svg,webp}'
  36. )
  37. ).pipe(
  38. gulp.dest(path.join(
  39. config.paths.dest,
  40. config.paths.assets,
  41. config.paths.images
  42. ))
  43. );
  44. cb();
  45. };