gulpfile.js 523 B

12345678910111213141516171819202122
  1. const { src, dest, series } = require('gulp');
  2. const del = require('del');
  3. const from = {
  4. path: [
  5. './assets/**/*',
  6. // './bower_components/**/*',(第二次以后的更新不用)
  7. // './index.html',(第二次以后的更新不用)
  8. ]
  9. };
  10. // 清理dist文件夹
  11. const cleanDist = async (cb) => {
  12. await del(['dist/**']);
  13. cb();
  14. }
  15. // 移动assets文件夹的内容到dist
  16. const moveAssets = (cb) => {
  17. src(from.path,{base:'./'})
  18. .pipe(dest('dist'));
  19. cb();
  20. }
  21. exports.build = series(cleanDist, moveAssets);