You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

93 lines
2.0 KiB

  1. var gulp = require("gulp");
  2. var merge = require('merge-stream');
  3. var babel = require("gulp-babel");
  4. var uglify = require('gulp-uglify');
  5. var concat = require('gulp-concat');
  6. var nodemon = require('gulp-nodemon');
  7. var plumber = require('gulp-plumber');
  8. var zip = require('gulp-zip');
  9. var tar = require('gulp-tar');
  10. var gzip = require('gulp-gzip');
  11. var sass = require('gulp-sass');
  12. var cleanCSS = require('gulp-clean-css');
  13. var include = require("gulp-include");
  14. /**
  15. * Paths
  16. *
  17. * @type {Object}
  18. */
  19. var paths = {
  20. scriptlibs: {
  21. },
  22. scriptapps: [
  23. './client/js/components/*.js',
  24. './client/js/app.js'
  25. ],
  26. scriptappswatch: [
  27. './client/js/**/*.js'
  28. ],
  29. csslibs: [
  30. ],
  31. cssapps: [
  32. './client/css/app.scss'
  33. ],
  34. cssappswatch: [
  35. './client/css/**/*.scss'
  36. ],
  37. fonts: [
  38. './node_modules/font-awesome/fonts/*-webfont.*',
  39. '!./node_modules/font-awesome/fonts/*-webfont.svg'
  40. ],
  41. deploypackage: [
  42. './**/*',
  43. '!node_modules', '!node_modules/**',
  44. '!coverage', '!coverage/**',
  45. '!client/js', '!client/js/**',
  46. '!dist', '!dist/**',
  47. '!tests', '!tests/**',
  48. '!gulpfile.js', '!inch.json', '!config.json', '!wiki.sublime-project'
  49. ]
  50. };
  51. /**
  52. * TASK - Starts server in development mode
  53. */
  54. gulp.task('server', ['scripts', 'css', 'fonts'], function() {
  55. nodemon({
  56. script: './server',
  57. ignore: ['public/', 'client/', 'tests/'],
  58. ext: 'js json',
  59. env: { 'NODE_ENV': 'development' }
  60. });
  61. });
  62. /**
  63. * TASK - Start dev watchers
  64. */
  65. gulp.task('watch', function() {
  66. gulp.watch([paths.scriptappswatch], ['scripts-app']);
  67. gulp.watch([paths.cssappswatch], ['css-app']);
  68. });
  69. /**
  70. * TASK - Starts development server with watchers
  71. */
  72. gulp.task('default', ['watch', 'server']);
  73. /**
  74. * TASK - Creates deployment packages
  75. */
  76. gulp.task('deploy', ['scripts', 'css', 'fonts'], function() {
  77. var zipStream = gulp.src(paths.deploypackage)
  78. .pipe(zip('requarks-wiki.zip'))
  79. .pipe(gulp.dest('dist'));
  80. var targzStream = gulp.src(paths.deploypackage)
  81. .pipe(tar('requarks-wiki.tar'))
  82. .pipe(gzip())
  83. .pipe(gulp.dest('dist'));
  84. return merge(zipStream, targzStream);
  85. });