gulpfile.js 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. const gulp = require('gulp'),
  2. concat = require("gulp-concat"),
  3. rename = require("gulp-rename"),
  4. cleanCSS = require('gulp-clean-css'),
  5. order = require('gulp-order'),
  6. uglify = require('gulp-uglify'),
  7. streamqueue = require('streamqueue'),
  8. pipeline = require('readable-stream').pipeline;
  9. gulp.task('copy', async function() {
  10. gulp.src('./node_modules/bootstrap/dist/js/bootstrap.js')
  11. .pipe(rename('v3-bootstrap.js'))
  12. .pipe(gulp.dest('./js/'));
  13. gulp.src('./node_modules/bootstrap/dist/css/bootstrap.css')
  14. .pipe(rename('v3-bootstrap.css'))
  15. .pipe(gulp.dest('./css/'));
  16. gulp.src('./node_modules/popper.js/dist/umd/popper.js')
  17. .pipe(rename('v3-popper.js'))
  18. .pipe(gulp.dest('./js/'));
  19. gulp.src('./node_modules/jquery/dist/jquery.min.js')
  20. .pipe(rename('v3-jquery.js'))
  21. .pipe(gulp.dest('./js/'));
  22. gulp.src('./node_modules/jasny-bootstrap/dist/js/jasny-bootstrap.min.js')
  23. .pipe(rename('v3-jasny-bootstrap.js'))
  24. .pipe(gulp.dest('./js/'));
  25. gulp.src('./node_modules/jasny-bootstrap/dist/css/jasny-bootstrap.css')
  26. .pipe(rename('v3-jasny-bootstrap.css'))
  27. .pipe(gulp.dest('./css/'));
  28. gulp.src('./node_modules/animate.css/animate.css')
  29. .pipe(rename('v3-animate.css'))
  30. .pipe(gulp.dest('./css/'));
  31. gulp.src('./node_modules/svg-morpheus/compile/minified/svg-morpheus.js')
  32. .pipe(rename('v3-svg-morpheus.js'))
  33. .pipe(gulp.dest('./js/'));
  34. gulp.src('./node_modules/moment/min/moment.min.js')
  35. .pipe(rename('v3-moment.js'))
  36. .pipe(gulp.dest('./js/'));
  37. gulp.src('./node_modules/@fullcalendar/core/main.js')
  38. .pipe(rename('v3-fullcalendar.js'))
  39. .pipe(gulp.dest('./js/'));
  40. gulp.src('./node_modules/@fullcalendar/core/main.css')
  41. .pipe(rename('v3-fullcalendar.css'))
  42. .pipe(gulp.dest('./css/'));
  43. gulp.src('./node_modules/@fullcalendar/google-calendar/main.js')
  44. .pipe(rename('v3-fullcalendar-google.js'))
  45. .pipe(gulp.dest('./js/'));
  46. gulp.src('./node_modules/@fullcalendar/daygrid/main.js')
  47. .pipe(rename('v3-fullcalendar-daygrid.js'))
  48. .pipe(gulp.dest('./js/'));
  49. gulp.src('./node_modules/@fullcalendar/daygrid/main.css')
  50. .pipe(rename('v3-fullcalendar-daygrid.css'))
  51. .pipe(gulp.dest('./css/'));
  52. console.log("files 📄 from npm pkgs ");
  53. });
  54. gulp.task('css', async function() {
  55. return streamqueue({ objectMode: true },
  56. gulp.src('./css/fonts.css'),
  57. gulp.src('./css/v3-animate.css'),
  58. gulp.src('./css/v3-fullcalendar-daygrid.css'),
  59. gulp.src('./css/v3-fullcalendar.css'),
  60. gulp.src('./css/v3-bootstrap.css'),
  61. gulp.src('./style.css')
  62. )
  63. .pipe(concat('v3-style.css'))
  64. .pipe(cleanCSS({level: {1: {specialComments: 0}}}))
  65. .pipe(rename('v3-style.min.css'))
  66. .pipe(gulp.dest('./', { overwrite:true }));
  67. gulp.src('css/front-page.css')
  68. .pipe(cleanCSS({level: {1: {specialComments: 0}}}))
  69. .pipe(rename('v3-front.min.css'))
  70. .pipe(gulp.dest('./css/', { overwrite:true }));
  71. console.log("CSS built 🔧 ");
  72. });
  73. gulp.task('cssf', async function() {
  74. gulp.src('css/front-page.css')
  75. .pipe(cleanCSS({level: {1: {specialComments: 0}}}))
  76. .pipe(rename('v3-front.min.css'))
  77. .pipe(gulp.dest('./css/', { overwrite:true }));
  78. console.log("CSSF built 🔧 ");
  79. });
  80. gulp.task('js', async function() {
  81. return streamqueue({ objectMode: true },
  82. gulp.src('./js/v3-jquery.js'),
  83. gulp.src('./js/v3-popper.js'),
  84. gulp.src('./js/v3-bootstrap.js'),
  85. gulp.src('./js/v3-jasny-bootstrap.js'),
  86. gulp.src('./js/v3-moment.js'),
  87. gulp.src('./js/v3-fullcalendar.js'),
  88. gulp.src('./js/v3-fullcalendar-daygrid.js'),
  89. gulp.src('./js/v3-fullcalendar-google.js'),
  90. gulp.src('./js/modernizr.js'),
  91. gulp.src('./js/validate.js'),
  92. gulp.src('./js/scripts.js')
  93. )
  94. .pipe(concat('v3-script.js'))
  95. .pipe(uglify())
  96. .pipe(rename('v3-script.min.js'))
  97. .pipe(gulp.dest('./js/', { overwrite:true }))
  98. console.log("JS built 🔧 ");
  99. });
  100. gulp.task('jsf', async function() {
  101. return streamqueue({ objectMode: true },
  102. gulp.src('./js/v3-jquery.js'),
  103. gulp.src('./js/svg-morpheus.js'),
  104. gulp.src('./js/messenger.min.js'),
  105. gulp.src('./js/v3-bootstrap.js'),
  106. gulp.src('./js/terminal.js'),
  107. gulp.src('./js/front-page.js')
  108. )
  109. .pipe(concat('v3-front.js'))
  110. .pipe(uglify())
  111. .pipe(rename('v3-front.min.js'))
  112. .pipe(gulp.dest('./js/', { overwrite:true }))
  113. console.log("JSF built 🔧 ");
  114. });