gulpfile.js 699 B

12345678910111213141516171819202122232425262728293031323334
  1. const gulp = require('gulp'),
  2. concat = require('gulp-concat'),
  3. sass = require('gulp-sass');
  4. browserSync = require('browser-sync').create();
  5. function copy (cb) {
  6. gulp.src('src/index.html')
  7. .pipe(gulp.dest('dist'));
  8. cb();
  9. }
  10. function run() {
  11. browserSync.init({
  12. server: {
  13. baseDir: "./",
  14. index: "/index.html"
  15. }
  16. });
  17. function reload() {
  18. browserSync.reload();
  19. }
  20. gulp.watch('./css/*.scss', mixin);
  21. gulp.watch([
  22. './css/styles.css',
  23. './js/scripts.js'
  24. ]).on('change',gulp.series(build,purge, clean, reload));
  25. gulp.watch('./index.html').on('change',reload);
  26. console.log("🔥 Run");
  27. }
  28. exports.copy = copy;
  29. exports.run = run;