gulpfile.js 4.3 KB

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