Gulpfile.js 481 B

12345678910111213141516171819202122
  1. var gulp = require('gulp');
  2. var uglify = require('gulp-uglify');
  3. var concat = require('gulp-concat');
  4. var preserveFirstComment = function() {
  5. var set = false;
  6. return function() {
  7. if (set) return false;
  8. set = true;
  9. return true;
  10. };
  11. };
  12. gulp.task('uglify', function() {
  13. gulp.src('lib/marked.js')
  14. .pipe(uglify({preserveComments: preserveFirstComment()}))
  15. .pipe(concat('marked.min.js'))
  16. .pipe(gulp.dest('.'));
  17. });
  18. gulp.task('default', ['uglify']);