gulpfile.js 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. 'use strict';
  2. var gulp = require('gulp');
  3. var sass = require('gulp-sass');
  4. var rename = require('gulp-rename');
  5. var shell = require('gulp-shell')
  6. var watch = require('gulp-watch');
  7. var webserver = require('gulp-webserver');
  8. gulp.task('webserver', function() {
  9. gulp.src('.')
  10. .pipe(webserver({
  11. livereload: false,
  12. directoryListing: false,
  13. open: false,
  14. fallback: 'index.html'
  15. }));
  16. });
  17. gulp.task('scss', function () {
  18. gulp.src('./assets/css/main.scss')
  19. .pipe(sass().on('error', sass.logError))
  20. .pipe(gulp.dest('./assets/css/dist'));
  21. });
  22. gulp.task('gui', function () {
  23. gulp.src('./assets/css/gui.scss')
  24. .pipe(sass().on('error', sass.logError))
  25. .pipe(gulp.dest('./assets/css/dist'));
  26. });
  27. gulp.task('sync', shell.task([
  28. './bin/sync.sh'
  29. ]));
  30. gulp.task('build', ['sync'], shell.task([
  31. './bin/build.py'
  32. ]));
  33. // default gulp task
  34. gulp.task('default', ['build', 'scss', 'gui', 'webserver'], function() {
  35. gulp.watch('./assets/css/**/*.scss', ['scss']);
  36. gulp.watch('./assets/css/gui.scss', ['gui']);
  37. gulp.watch(['bin/build.py', './book-src/*', './templates/*.tpl.html'], ['build']);
  38. });