forked from ww24/mace
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
58 lines (49 loc) · 1.4 KB
/
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
/**
* Gulp build script
*/
var ace_deps = [
"ace.js",
"mode-markdown.js",
"theme-chrome.js"
];
var gulp = require("gulp"),
plug = require("gulp-load-plugins")(),
del = require("del");
ace_deps = ace_deps.map(function (file) {
return "ace/build/src-min-noconflict/" + file;
});
gulp.task("clean", function (done) {
del(["build/*", "coverage/*"], done);
});
gulp.task("mace", function () {
return gulp.src("src/*.coffee")
.pipe(plug.coffee())
.pipe(plug.concat("mace-core.js"))
.pipe(gulp.dest("build/deps"))
.pipe(plug.uglify({preserveComments: "some"}))
.pipe(plug.concat("mace-core.min.js"))
.pipe(gulp.dest("build/deps"));
});
gulp.task("ace", function () {
return gulp.src(ace_deps)
.pipe(plug.insert.append(";"))
.pipe(plug.concat("ace.min.js"))
.pipe(gulp.dest("build/deps"));
});
gulp.task("marked", function () {
return gulp.src("node_modules/marked/lib/marked.js")
.pipe(plug.uglify({preserveComments: function (node, comment) {
// check license comment
return !!~ comment.value.indexOf("Licensed");
}}))
.pipe(plug.concat("marked.min.js"))
.pipe(gulp.dest("build/deps"));
});
gulp.task("concat", ["mace", "ace", "marked"], function () {
return gulp.src("build/deps/*.min.js")
.pipe(plug.concat("mace.min.js"))
.pipe(gulp.dest("build"));
});
gulp.task("default", ["clean"], function () {
gulp.start("concat");
});