gulpfile.js 879 B

12345678910111213141516171819202122232425262728293031
  1. var gulp = require('gulp'),
  2. less = require('gulp-less'),
  3. rename = require('gulp-rename'),
  4. minify = require('gulp-cssnano');
  5. gulp.task('less', function () {
  6. return gulp.src('./static/stylesheet/style.less')
  7. .pipe(less())
  8. .pipe(minify())
  9. .pipe(rename({
  10. extname: '.min.css'
  11. }))
  12. .pipe(gulp.dest('./static/stylesheet'));
  13. });
  14. gulp.task('cp', function () {
  15. return gulp.src('./node_modules/font-awesome/**/*.{min.css,otf,eot,svg,ttf,woff,woff2}')
  16. .pipe(gulp.dest('./static/font-awesome'));
  17. });
  18. gulp.task('pygments', function () {
  19. return gulp.src(['./static/pygments/*.css', '!./static/pygments/*min.css'])
  20. .pipe(minify())
  21. .pipe(rename({
  22. extname: '.min.css'
  23. }))
  24. .pipe(gulp.dest('./static/pygments'));
  25. });
  26. gulp.task('default', ['less', 'cp', 'pygments']);