Skip to content

Commit

Permalink
Merge pull request markedjs#553 from minecrafter/add-gulpfile
Browse files Browse the repository at this point in the history
Add a Gulpfile
  • Loading branch information
chjj committed May 8, 2015
2 parents 489241b + 0b64560 commit d74656d
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 1 deletion.
22 changes: 22 additions & 0 deletions Gulpfile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
var gulp = require('gulp');
var uglify = require('gulp-uglify');
var concat = require('gulp-concat');

var preserveFirstComment = function() {
var set = false;

return function() {
if (set) return false;
set = true;
return true;
};
};

gulp.task('uglify', function() {
gulp.src('lib/marked.js')
.pipe(uglify({preserveComments: preserveFirstComment()}))
.pipe(concat('marked.min.js'))
.pipe(gulp.dest('.'));
});

gulp.task('default', ['uglify']);
5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,10 @@
"devDependencies": {
"markdown": "*",
"showdown": "*",
"robotskirt": "*"
"robotskirt": "*",
"gulp": "^3.8.11",
"gulp-uglify": "^1.1.0",
"gulp-concat": "^2.5.2"
},
"scripts": { "test": "node test", "bench": "node test --bench" }
}

0 comments on commit d74656d

Please sign in to comment.