-
Notifications
You must be signed in to change notification settings - Fork 1
/
gulpfile.js
40 lines (34 loc) · 1021 Bytes
/
gulpfile.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
"use strict";
var gulp = require("gulp"),
uglify = require("gulp-uglify"),
concat = require("gulp-concat"),
header = require("gulp-header"),
buffer = require("vinyl-buffer"),
pkg = require("./package.json"),
browserify = require("browserify"),
source = require("vinyl-source-stream");
var banner = ["/**",
" * <%= pkg.name %> v<%= pkg.version %>",
" * Copyright <%= pkg.company %>",
" * @link <%= pkg.homepage %>",
" * @license <%= pkg.license %>",
" */",
""].join("\n");
gulp.task("browserify", [], function() {
return browserify("./js/markjax.js", {standalone: "markjax"})
.bundle()
.pipe(source("markjax.js"))
.pipe(buffer())
.pipe(header(banner, {pkg: pkg}))
.pipe(gulp.dest("./dist/"));
});
gulp.task("scripts", ["browserify"], function() {
var js_files = ["./dist/markjax.js"];
return gulp.src(js_files)
.pipe(concat("markjax.min.js"))
//.pipe(uglify())
.pipe(buffer())
.pipe(header(banner, {pkg: pkg}))
.pipe(gulp.dest("./dist/"));
});
gulp.task("default", ["scripts"]);