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.
 
 
 

56 rivejä
1.6 KiB

  1. // Copyright (c) Microsoft. All rights reserved. Licensed under the MIT license. See LICENSE file in the project root for full license information.
  2. var path = require('path');
  3. var gulp = require('gulp');
  4. var minify = require('gulp-minify-css');
  5. var rename = require('gulp-rename');
  6. var concat = require('gulp-concat');
  7. var copy = require('gulp-copy');
  8. var vendor = {
  9. css: ['bower_components/bootstrap/dist/css/bootstrap.css',
  10. 'bower_components/highlightjs/styles/github-gist.css'
  11. ],
  12. js: ['bower_components/jquery/dist/jquery.min.js',
  13. 'bower_components/bootstrap/dist/js/bootstrap.min.js',
  14. 'bower_components/highlightjs/highlight.pack.min.js',
  15. 'bower_components/lunr.js/lunr.min.js',
  16. 'bower_components/js-url/url.min.js',
  17. 'bower_components/twbs-pagination/jquery.twbsPagination.min.js',
  18. "bower_components/mark.js/dist/jquery.mark.min.js"
  19. ],
  20. webWorker: {
  21. src: ['lunr.min.js'],
  22. cwd: 'bower_components/lunr.js/'
  23. },
  24. font: {
  25. src: ['*'],
  26. cwd: 'bower_components/bootstrap/dist/fonts/'
  27. }
  28. }
  29. gulp.task('concat', function () {
  30. gulp.src(vendor.css)
  31. .pipe(minify({keepBreaks: true}))
  32. .pipe(rename({
  33. suffix: '.min'
  34. }))
  35. .pipe(concat('docfx.vendor.css'))
  36. .pipe(gulp.dest('./styles/'))
  37. ;
  38. gulp.src(vendor.js)
  39. .pipe(concat('docfx.vendor.js'))
  40. .pipe(gulp.dest('./styles/'))
  41. ;
  42. });
  43. gulp.task('copy', function () {
  44. gulp.src(vendor.font.src, {cwd: vendor.font.cwd})
  45. .pipe(copy('./fonts/'))
  46. ;
  47. gulp.src(vendor.webWorker.src, {cwd:vendor.webWorker.cwd})
  48. .pipe(copy('./styles/'))
  49. ;
  50. });
  51. gulp.task('default', ['concat', 'copy']);