-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
55 lines (44 loc) · 1.12 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
var gulp = require("gulp");
var htmlMin = require("gulp-htmlmin");
var concat = require("gulp-concat");
var cssConcat = require("gulp-concat-css");
var cleanCSS = require("gulp-clean-css");
var uglify = require("gulp-uglify");
var pump = require("pump");
var cssPaths = [
"./css/codemirror.css",
"./css/monokai.css",
"./css/main.css"
];
var jsPaths = [
"./libs/codemirror.js",
"./libs/xml.js",
"./libs/css.js",
"./libs/javascript.js",
"./js/helpers.js",
"./js/app.js"
];
gulp.task("html", function() {
return gulp.src("./dist/index.html")
.pipe(htmlMin({collapseWhitespace: true}))
.pipe(gulp.dest("dist"));
});
gulp.task("css", function() {
return gulp.src(cssPaths)
.pipe(cssConcat("css/bundle.css"))
.pipe(cleanCSS())
.pipe(gulp.dest("dist"));
});
gulp.task("scripts", function() {
return gulp.src(jsPaths)
.pipe(concat("bundle.js"))
.pipe(gulp.dest("./dist/"));
});
gulp.task("compress", function(cb) {
pump([
gulp.src("./dist/bundle.js"),
uglify(),
gulp.dest("dist")
], cb);
});
gulp.task("default", ["scripts", "compress", "css"]);