clean.js 544 B

12345678910111213141516171819202122
  1. import config from '../config';
  2. import path from 'path';
  3. import del from 'del';
  4. /**
  5. * Clean build products
  6. *
  7. * @param cb: callback handler passed by gulp, signals task completion when called
  8. */
  9. export const clean = (cb) => {
  10. const assetPath = path.join(config.paths.dest, config.paths.assets);
  11. del([
  12. path.join(assetPath, config.paths.css, '/**/*'),
  13. path.join(assetPath, config.paths.fonts, '/**/*'),
  14. path.join(assetPath, config.paths.images, '/**/*'),
  15. path.join(assetPath, config.paths.js, '/**/*')
  16. ]);
  17. cb();
  18. };