build-es.js 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. import path from 'path'
  2. import gulp from 'gulp'
  3. import * as utils from './build-utils'
  4. import getOutput from './get-output'
  5. const srcPath = `${getOutput()}/core`
  6. const buildPath = `${getOutput()}/es`
  7. const files = utils.files
  8. const paths = {
  9. styles: {
  10. src: [`${srcPath}/**/*.less`],
  11. dest: buildPath,
  12. },
  13. colors: {
  14. src: [`${srcPath}/helpers/colors.js`],
  15. dest: buildPath,
  16. },
  17. copy: {
  18. src: [`${srcPath}*`],
  19. dest: buildPath,
  20. },
  21. }
  22. paths.styles.src = [
  23. `${srcPath}/styles/*.less`,
  24. ...files.map((v) => `${srcPath}/${v}/*.less`),
  25. ]
  26. paths.copy.src = [
  27. ...files.map((v) => `${srcPath}/${v}/**`),
  28. `!${srcPath}/**/*.less`,
  29. `!${srcPath}/icon/fonts/**`,
  30. `${srcPath}/helpers/**`,
  31. `${srcPath}/index.js`,
  32. `${srcPath}/config.json`,
  33. ]
  34. export default gulp.series(
  35. gulp.parallel(
  36. utils.styles(paths.styles, srcPath, false),
  37. utils.copy(paths.copy, srcPath),
  38. // utils.generateFiles(buildPath, false),
  39. // utils.generateConfig(buildPath),
  40. ),
  41. utils.generateColors(paths.colors, srcPath, false),
  42. )