gulpfile.js 544 B

12345678910111213141516171819202122232425262728
  1. const { src, dest, series } = require('gulp');
  2. const del = require('del');
  3. const from = {
  4. path: [
  5. './css/**/*',
  6. './imgs/**/*',
  7. './js/**/*',
  8. './libs/**/*',
  9. './backgroundsize.min.htc',
  10. './index.html',
  11. './login.html',
  12. './PIE.htc',
  13. ]
  14. };
  15. // 清理dist文件夹
  16. const cleanDist = async (cb) => {
  17. await del(['dist/**']);
  18. cb();
  19. }
  20. // 移动assets文件夹的内容到dist
  21. const moveAssets = (cb) => {
  22. src(from.path,{base:'./'})
  23. .pipe(dest('dist'));
  24. cb();
  25. }
  26. exports.build = series(cleanDist, moveAssets);